Fix save draft sheet showing even when draft had no content

This commit is contained in:
Shadowfacts 2020-09-07 17:15:18 -04:00
parent b4ddb8f533
commit fe1db72f19
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 7 additions and 1 deletions

View File

@ -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()
}
}
}