Skip to content

Commit

Permalink
Preventing marking note as changed when nor text nor tags changed whe…
Browse files Browse the repository at this point in the history
…n leaving note screen.
  • Loading branch information
Dima-Android committed Oct 1, 2024
1 parent 9b7bca6 commit 417836d
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,16 @@ internal class AddNoteViewModel @Inject constructor(

private fun saveAndExit() {
val args = ScreenArguments.addOrEditNoteArgs
EventBus.getDefault().post(
SaveNoteAction(
text = viewState.text,
tags = viewState.tags,
key = args.key,
isFromDashboard = args.isFromDashboard
if (args.text != viewState.text || args.tags != viewState.tags) {
EventBus.getDefault().post(
SaveNoteAction(
text = viewState.text,
tags = viewState.tags,
key = args.key,
isFromDashboard = args.isFromDashboard
)
)
)
}
triggerEffect(AddNoteViewEffect.NavigateBack)
}
}
Expand Down

0 comments on commit 417836d

Please sign in to comment.