forked from shadowfacts/Tusker
Don't show warning when loading draft on top of for empty statuses
Closes #87
This commit is contained in:
parent
5bed38f661
commit
804636dcbb
|
@ -632,7 +632,7 @@ extension ComposeViewController: DraftsTableViewControllerDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func shouldSelectDraft(_ draft: DraftsManager.Draft, completion: @escaping (Bool) -> Void) {
|
func shouldSelectDraft(_ draft: DraftsManager.Draft, completion: @escaping (Bool) -> Void) {
|
||||||
if draft.inReplyToID != self.inReplyToID {
|
if draft.inReplyToID != self.inReplyToID, hasChanges {
|
||||||
let alertController = UIAlertController(title: "Different Reply", message: "The selected draft is a reply to a different status, do you wish to use it?", preferredStyle: .alert)
|
let alertController = UIAlertController(title: "Different Reply", message: "The selected draft is a reply to a different status, do you wish to use it?", preferredStyle: .alert)
|
||||||
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: { (_) in
|
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: { (_) in
|
||||||
completion(false)
|
completion(false)
|
||||||
|
@ -649,6 +649,10 @@ extension ComposeViewController: DraftsTableViewControllerDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func draftSelected(_ draft: DraftsManager.Draft) {
|
func draftSelected(_ draft: DraftsManager.Draft) {
|
||||||
|
if hasChanges {
|
||||||
|
saveDraft()
|
||||||
|
}
|
||||||
|
|
||||||
self.currentDraft = draft
|
self.currentDraft = draft
|
||||||
|
|
||||||
inReplyToID = draft.inReplyToID
|
inReplyToID = draft.inReplyToID
|
||||||
|
|
Loading…
Reference in New Issue