From 2609cb07b7841a63e5f64a8f23cd274f4379bc53 Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Tue, 18 Aug 2020 18:06:23 +0200 Subject: [PATCH] fix: do not show placeholder notes in smart tags --- app/assets/javascripts/views/notes/notes_view.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/views/notes/notes_view.ts b/app/assets/javascripts/views/notes/notes_view.ts index c6a5b4783..9ef153232 100644 --- a/app/assets/javascripts/views/notes/notes_view.ts +++ b/app/assets/javascripts/views/notes/notes_view.ts @@ -331,6 +331,11 @@ class NotesViewCtrl extends PureViewCtrl { ) } + currentTagCanHavePlaceholderNotes() { + const selectedTag = this.application!.getAppState().getSelectedTag()!; + return selectedTag.isAllTag || !selectedTag.isSmartTag() + } + private async performReloadNotes() { const tag = this.appState.selectedTag!; if (!tag) { @@ -338,7 +343,10 @@ class NotesViewCtrl extends PureViewCtrl { } const notes = this.application.getDisplayableItems(ContentType.Note) as SNNote[]; let renderedNotes: SNNote[]; - if (this.appState.getActiveEditor()?.isTemplateNote) { + if ( + this.appState.getActiveEditor()?.isTemplateNote && + this.currentTagCanHavePlaceholderNotes() + ) { renderedNotes = [this.appState.getActiveEditor().note, ...notes.slice(0, this.notesToDisplay)]; } else { renderedNotes = notes.slice(0, this.notesToDisplay);