forked from shadowfacts/Tusker
Fix save draft sheet showing even when draft had no content
This commit is contained in:
parent
b4ddb8f533
commit
fe1db72f19
|
@ -145,7 +145,13 @@ struct ComposeView: View {
|
||||||
// draft is already stored in drafts manager, drafts manager is saved by ComposeHostingController.viewWillDisappear
|
// draft is already stored in drafts manager, drafts manager is saved by ComposeHostingController.viewWillDisappear
|
||||||
uiState.delegate?.dismissCompose()
|
uiState.delegate?.dismissCompose()
|
||||||
} else {
|
} else {
|
||||||
|
// if the draft doesn't have content, it doesn't need to be saved
|
||||||
|
if draft.hasContent {
|
||||||
uiState.isShowingSaveDraftSheet = true
|
uiState.isShowingSaveDraftSheet = true
|
||||||
|
} else {
|
||||||
|
DraftsManager.shared.remove(draft)
|
||||||
|
uiState.delegate?.dismissCompose()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue