From fe1db72f193bab9c5de0c7be1e96ed9bf2b9f177 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 7 Sep 2020 17:15:18 -0400 Subject: [PATCH] Fix save draft sheet showing even when draft had no content --- Tusker/Screens/Compose/ComposeView.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Compose/ComposeView.swift b/Tusker/Screens/Compose/ComposeView.swift index fc23aff9..5d21fcaa 100644 --- a/Tusker/Screens/Compose/ComposeView.swift +++ b/Tusker/Screens/Compose/ComposeView.swift @@ -145,7 +145,13 @@ struct ComposeView: View { // draft is already stored in drafts manager, drafts manager is saved by ComposeHostingController.viewWillDisappear uiState.delegate?.dismissCompose() } else { - uiState.isShowingSaveDraftSheet = true + // if the draft doesn't have content, it doesn't need to be saved + if draft.hasContent { + uiState.isShowingSaveDraftSheet = true + } else { + DraftsManager.shared.remove(draft) + uiState.delegate?.dismissCompose() + } } }