Skip to content

[Bug]: Incorrect message displayed when unlocking notes #1001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
runnnnnner200 opened this issue Feb 25, 2025 · 0 comments
Open

[Bug]: Incorrect message displayed when unlocking notes #1001

runnnnnner200 opened this issue Feb 25, 2025 · 0 comments

Comments

@runnnnnner200
Copy link

Describe the bug

When unlocking or locking a note, the app always displays the message "Save note to lock it" regardless of whether the note is being locked or unlocked. The message should be different depending on whether the note is being locked or unlocked.

To Reproduce
Steps to reproduce the behavior:

  1. Create a note in the app.
  2. Unlock the note.
  3. The app will show the incorrect message "Save note to lock it"

Expected behavior
The message should be dynamic and show:

  • "Save note to lock it" when locking a note.
  • "Save note to unlock it" when unlocking a note.

Related Code:
Link to relevant code

Suggested Fix:

private void lockUnlock() { 
    // Empty password has been set
    if (Prefs.getString(PREF_PASSWORD, null) == null) {
      mainActivity.showMessage(R.string.password_not_set, ONStyle.WARN);
      return;
    }
    
    // Show different message based on the lock state
    if (noteTmp.isLocked()) {
        mainActivity.showMessage(R.string.save_note_to_unlock_it, ONStyle.INFO);
    } else {
        mainActivity.showMessage(R.string.save_note_to_lock_it, ONStyle.INFO);
    }
    
    mainActivity.supportInvalidateOptionsMenu();
    noteTmp.setLocked(!noteTmp.isLocked());
    noteTmp.setPasswordChecked(true);
}

I look forward to your feedback and hope this can be addressed soon. Thank you for your attention to this matter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant