From c7d913f7ad9c9c9dc5393fb3ebdb0d465fc1d26a Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Tue, 12 Feb 2019 15:02:19 -0600 Subject: [PATCH] Fixes issue with dummy note on sign in --- app/assets/javascripts/app/controllers/notes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/notes.js b/app/assets/javascripts/app/controllers/notes.js index 0367bb0ca..e6bacd5be 100644 --- a/app/assets/javascripts/app/controllers/notes.js +++ b/app/assets/javascripts/app/controllers/notes.js @@ -81,7 +81,9 @@ angular.module('app') this.reloadNotes = function() { let notes = this.tag.notes; - if(notes.length > 0 && notes[0].dummy == false && this.selectedNote && this.selectedNote.dummy) { + // If there is more than 1 note, and this.selectedNote is dummy, that means there are at least two notes + // And the dummy can be removed + if(notes.length > 1 && this.selectedNote && this.selectedNote.dummy) { // remove dummy modelManager.removeItemLocally(this.selectedNote); notes = _.pull(notes, this.selectedNote);