fix: select home navigation view when creating note inside smart view (#1059)

This commit is contained in:
Mo
2022-06-01 09:23:23 -05:00
committed by GitHub
parent c252a066fc
commit 78f39ec85d
9 changed files with 62 additions and 65 deletions

View File

@@ -380,6 +380,10 @@ export class ContentListViewState extends AbstractState {
createNewNote = async () => {
this.appState.notes.unselectNotes()
if (this.appState.tags.isInSmartView() && !this.appState.tags.isInHomeView()) {
await this.appState.tags.selectHomeNavigationView()
}
let title = `Note ${this.notes.length + 1}`
if (this.isFiltering) {
title = this.noteFilterText
@@ -387,12 +391,11 @@ export class ContentListViewState extends AbstractState {
await this.appState.notes.createNewNoteController(title)
this.appState.noteTags.reloadTags()
this.appState.noteTags.reloadTagsForCurrentNote()
}
createPlaceholderNote = () => {
const selectedTag = this.appState.tags.selected
if (selectedTag && selectedTag instanceof SmartView && selectedTag.uuid !== SystemViewId.AllNotes) {
if (this.appState.tags.isInSmartView() && !this.appState.tags.isInHomeView()) {
return
}