Skip to content

Commit

Permalink
Hide option to add contacts manually when chatmail (#2275)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Aug 21, 2024
1 parent 13cbb37 commit 5faa332
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions deltachat-ios/Controller/QrPageController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,18 @@ class QrPageController: UIPageViewController {
alert.addAction(UIAlertAction(title: String.localized("withdraw_qr_code"), style: .default, handler: withdrawQrCode(_:)))
}
alert.addAction(UIAlertAction(title: String.localized("paste_from_clipboard"), style: .default, handler: pasteFromClipboard(_:)))
alert.addAction(UIAlertAction(title: String.localized("menu_new_classic_contact"), style: .default, handler: { [weak self] _ in
guard let self else { return }

let newContactController = NewContactController(dcContext: self.dcContext)
self.navigationController?.pushViewController(newContactController, animated: true)
}))


if dcContext.isChatmail == false {
let addContactManuallyAction = UIAlertAction(title: String.localized("menu_new_classic_contact"), style: .default, handler: { [weak self] _ in
guard let self else { return }

let newContactController = NewContactController(dcContext: self.dcContext)
self.navigationController?.pushViewController(newContactController, animated: true)
})

alert.addAction(addContactManuallyAction)
}

alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel))
self.present(alert, animated: true, completion: nil)
Expand Down

0 comments on commit 5faa332

Please sign in to comment.