Skip to content

Commit

Permalink
fix: do not show placeholder notes in smart tags
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Aug 18, 2020
1 parent 5bd35a5 commit 2609cb0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/assets/javascripts/views/notes/notes_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,22 @@ 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) {
return;
}
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);
Expand Down

0 comments on commit 2609cb0

Please sign in to comment.