Skip to content
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

Mobile: Fixes #11384: Fix switching notes then unloading app causes blank screen #11396

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Nov 16, 2024

Summary

This pull request updates Note.tsx to:

  1. Continue displaying the previous note even if selectedNoteIds is empty.
  2. Not disable the folder picker if selectedNoteIds is empty.

Fixes #11384.

Note

This pull request targets release-3.1.

Explanation

After following a link or changing the parent folder of the open note, state.selectedNoteIds can contain notes from different (unselected) folders. When refreshNotes is called, it removes notes from selectedNoteIds if they are not in the selected notebook/tag/smart filter. This causes selectedNoteIds to be set to [] when refreshNotes is called after moving the open note to a different folder or following a link to a note in a different folder.

Testing plan

Android 13:

  1. Create two notes in different notebooks.
  2. Add a link from one note to the other.
  3. Open the note with the link from the notes list.
  4. Follow the link.
  5. Turn the device off.
  6. Turn the device back on.
  7. Verify that the note is still open.
  8. Verify that the "select folder" dropdown is not disabled.
  9. Change the note's parent folder using the "select folder" dropdown.
  10. Press the back button.
  11. Verify that the note from step 3 is open.
  12. Press the back button.
  13. Verify that both notes are visible in the notes list.
  14. Select both notes.
  15. Using the "move to notebook..." dropdown, move both notes to a different notebook.

… causes blank screen

This issue is caused by `Notes.tsx` removing the current note from
`state.notes` (due to not being in the current parent item). This
then causes the editor to unload.

This change needs:
- Manual testing
…ctedNoteIds is empty

This updates Note.tsx to continue showing the previous note even if
selectedNoteIds is empty, which can happen if a link or "move to folder"
action moves the current note out of the selected folder. This matches the behavior prior to the fix for
issue laurent22#10677.
Repository owner deleted a comment from awesome-pro Nov 16, 2024
@laurent22 laurent22 merged commit bb66e81 into laurent22:release-3.1 Nov 16, 2024
10 checks passed
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

Successfully merging this pull request may close these issues.

2 participants