소스 검색

add a delete-profile-image-option only when there is a profile image

B. Petersen 5 년 전
부모
커밋
0527fce71f
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      deltachat-ios/Controller/EditSettingsController.swift

+ 4 - 1
deltachat-ios/Controller/EditSettingsController.swift

@@ -158,9 +158,12 @@ class EditSettingsController: UITableViewController, MediaPickerDelegate {
         let photoAction = PhotoPickerAlertAction(title: String.localized("gallery"), style: .default, handler: galleryButtonPressed(_:))
         let videoAction = PhotoPickerAlertAction(title: String.localized("camera"), style: .default, handler: cameraButtonPressed(_:))
         let deleteAction = UIAlertAction(title: String.localized("delete"), style: .destructive, handler: deleteProfileIconPressed(_:))
+
         alert.addAction(photoAction)
         alert.addAction(videoAction)
-        alert.addAction(deleteAction)
+        if dcContext.getSelfAvatarImage() != nil {
+            alert.addAction(deleteAction)
+        }
         alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: nil))
 
         self.present(alert, animated: true, completion: nil)