Fix Delete when only one Snippet

## Description
The note page hangs when trying to delete the last snippet. This fix will break out of the loop when there are not any previous elements to delete.

### Testing Considerations
* [ ] Ensure delete doesn't hang when deleting last snippet in note