feat: daily notes (dev only) (#1894)
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user