feat: daily notes (dev only) (#1894)

This commit is contained in:
Mo
2022-10-27 17:21:31 -05:00
committed by GitHub
parent 064e054587
commit 69c3f2be83
47 changed files with 1535 additions and 158 deletions

View File

@@ -15,6 +15,7 @@ import {
InternalEventBus,
InternalEventPublishStrategy,
VectorIconNameOrEmoji,
isTag,
} from '@standardnotes/snjs'
import { action, computed, makeAutoObservable, makeObservable, observable, reaction, runInAction } from 'mobx'
import { WebApplication } from '../../Application/Application'
@@ -268,6 +269,13 @@ export class NavigationController
return this.selected instanceof SmartView && this.selected.uuid === id
}
public get selectedAsTag(): SNTag | undefined {
if (!this.selected || !isTag(this.selected)) {
return undefined
}
return this.selected
}
setAddingSubtagTo(tag: SNTag | undefined): void {
this.addingSubtagTo = tag
}
@@ -440,19 +448,21 @@ export class NavigationController
this.previouslySelected_ = this.selected_
this.setSelectedTagInstance(tag)
await runInAction(async () => {
this.setSelectedTagInstance(tag)
if (tag && this.application.items.isTemplateItem(tag)) {
return
}
if (tag && this.application.items.isTemplateItem(tag)) {
return
}
await this.eventBus.publishSync(
{
type: CrossControllerEvent.TagChanged,
payload: { tag, previousTag: this.previouslySelected_, userTriggered: userTriggered },
},
InternalEventPublishStrategy.SEQUENCE,
)
await this.eventBus.publishSync(
{
type: CrossControllerEvent.TagChanged,
payload: { tag, previousTag: this.previouslySelected_, userTriggered: userTriggered },
},
InternalEventPublishStrategy.SEQUENCE,
)
})
}
public async selectHomeNavigationView(): Promise<void> {