diff --git a/Tusker/Screens/Compose/ComposeViewController.swift b/Tusker/Screens/Compose/ComposeViewController.swift index d1c9cae5..644cc863 100644 --- a/Tusker/Screens/Compose/ComposeViewController.swift +++ b/Tusker/Screens/Compose/ComposeViewController.swift @@ -632,7 +632,7 @@ extension ComposeViewController: DraftsTableViewControllerDelegate { } 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) alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: { (_) in completion(false) @@ -649,6 +649,10 @@ extension ComposeViewController: DraftsTableViewControllerDelegate { } func draftSelected(_ draft: DraftsManager.Draft) { + if hasChanges { + saveDraft() + } + self.currentDraft = draft inReplyToID = draft.inReplyToID