Delete note if the content is completely removed #1665
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix
It was brought up in an issue for SNMac, that if a note is empty we leave it in the note list and it would be nice if they deleted themselves. I thought about this for a bit and decided that I agreed, but I wanted to make sure that we only moved the notes to the trash, that way the history for the note still exists and a user could reclaim the lost content if they wanted. So in this PR I have done that.
iOS already deleted new notes that were empty, so this PR simply updates that logic to not exclude existing notes. If a user deletes all the content in a note and then exits the editor the note will be moved to the trash. This is the same behavior as in apple notes.
Test
Confirm new notes with content are not deleted
Confirm new notes without content are deleted
Confirm an existing note that has all it's content removed, will be deleted
Review
(Required) Add instructions for reviewers. For example:
Release
(Required) Add a concise statement to
RELEASE-NOTES.txt
if the changes should be included in release notes. Include details about updating the notes in this section. For example: