Selaa lähdekoodia

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

B. Petersen 5 vuotta sitten
vanhempi
commit
0527fce71f
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  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)