File tree Expand file tree Collapse file tree
app/src/main/java/com/philkes/notallyx/presentation/activity/note Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -456,8 +456,10 @@ abstract class EditActivity(private val type: Type) :
456456 add(R .string.search, R .drawable.search, MenuItem .SHOW_AS_ACTION_ALWAYS ) {
457457 startSearch()
458458 }
459- add(R .string.reminders, R .drawable.notifications, MenuItem .SHOW_AS_ACTION_ALWAYS ) {
460- changeReminders()
459+ if (notallyModel.folder == Folder .NOTES ) {
460+ add(R .string.reminders, R .drawable.notifications, MenuItem .SHOW_AS_ACTION_ALWAYS ) {
461+ changeReminders()
462+ }
461463 }
462464 pinMenuItem =
463465 add(R .string.pin, R .drawable.pin, MenuItem .SHOW_AS_ACTION_ALWAYS ) { pin() }
@@ -1027,9 +1029,12 @@ abstract class EditActivity(private val type: Type) :
10271029 }
10281030
10291031 override fun changeReminders () {
1030- val intent = Intent (this , RemindersActivity ::class .java)
1031- intent.putExtra(RemindersActivity .NOTE_ID , notallyModel.id)
1032- startActivity(intent)
1032+ lifecycleScope.launch {
1033+ val noteId = notallyModel.id.takeIf { it != 0L } ? : saveNote(false )
1034+ val intent = Intent (this @EditActivity, RemindersActivity ::class .java)
1035+ intent.putExtra(RemindersActivity .NOTE_ID , noteId)
1036+ startActivity(intent)
1037+ }
10331038 }
10341039
10351040 override fun changeLabels () {
You can’t perform that action at this time.
0 commit comments