File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,7 @@ final class CommentComposerViewController: UIViewController {
6060 }
6161
6262 private func setupEditor( ) {
63- let content = viewModel. getInitialContent ( ) ?? " "
64-
63+ let content = viewModel. getInitialContent ( )
6564 if viewModel. isGutenbergEnabled {
6665 setupGutenbergEditor ( content: content)
6766 } else {
@@ -133,7 +132,7 @@ final class CommentComposerViewController: UIViewController {
133132 Task { @MainActor in
134133 await editor? . refresh ( )
135134 navigationItem. leftBarButtonItem? . isEnabled = true
136- if text. isEmpty {
135+ if text == viewModel . getInitialContent ( ) {
137136 presentingViewController? . dismiss ( animated: true )
138137 } else {
139138 showCloseDraftConfirmationAlert ( content: text)
Original file line number Diff line number Diff line change @@ -93,10 +93,11 @@ final class CommentComposerViewModel {
9393
9494 // MARK: Drafts
9595
96- func getInitialContent( ) -> String ? {
96+ // TODO: delete draft after sending a comment
97+ func getInitialContent( ) -> String {
9798 switch parameters. context {
9899 case . create, . reply:
99- return restoreDraft ( )
100+ return restoreDraft ( ) ?? " "
100101 case . edit( let comment) :
101102 return comment. rawContent
102103 }
You can’t perform that action at this time.
0 commit comments