fix: Fixed issue where a new note would not be correctly synced after making changes

This commit is contained in:
Aman Harwara
2023-04-13 00:06:53 +05:30
parent 6971e4c028
commit 9f824266ac
2 changed files with 6 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ export class NoteViewController implements ItemViewControllerInterface {
private defaultTagUuid: UuidString | undefined
private defaultTag?: SNTag
private syncController: NoteSyncController
private syncController!: NoteSyncController
constructor(
private application: WebApplication,
@@ -106,6 +106,7 @@ export class NoteViewController implements ItemViewControllerInterface {
this.isTemplateNote = true
this.item = note
this.syncController.setItem(this.item)
if (this.defaultTagUuid) {
const tag = this.application.items.findItem(this.defaultTagUuid) as SNTag

View File

@@ -25,6 +25,10 @@ export class NoteSyncController {
constructor(private application: WebApplication, private item: SNNote) {}
setItem(item: SNNote) {
this.item = item
}
deinit() {
if (this.saveTimeout) {
clearTimeout(this.saveTimeout)