Delete note if the content is completely removed #1216
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
In issue #1064 it was brought up 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 it made sense to me that we should have the same behavior in SNMac, and that we should update it to also delete notes that have become empty, not just new notes.
fixes #1064
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: