fix: Fixed issue where a new note would not be correctly synced after making changes
This commit is contained in:
@@ -26,7 +26,7 @@ export class NoteViewController implements ItemViewControllerInterface {
|
|||||||
private defaultTagUuid: UuidString | undefined
|
private defaultTagUuid: UuidString | undefined
|
||||||
private defaultTag?: SNTag
|
private defaultTag?: SNTag
|
||||||
|
|
||||||
private syncController: NoteSyncController
|
private syncController!: NoteSyncController
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private application: WebApplication,
|
private application: WebApplication,
|
||||||
@@ -106,6 +106,7 @@ export class NoteViewController implements ItemViewControllerInterface {
|
|||||||
|
|
||||||
this.isTemplateNote = true
|
this.isTemplateNote = true
|
||||||
this.item = note
|
this.item = note
|
||||||
|
this.syncController.setItem(this.item)
|
||||||
|
|
||||||
if (this.defaultTagUuid) {
|
if (this.defaultTagUuid) {
|
||||||
const tag = this.application.items.findItem(this.defaultTagUuid) as SNTag
|
const tag = this.application.items.findItem(this.defaultTagUuid) as SNTag
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ export class NoteSyncController {
|
|||||||
|
|
||||||
constructor(private application: WebApplication, private item: SNNote) {}
|
constructor(private application: WebApplication, private item: SNNote) {}
|
||||||
|
|
||||||
|
setItem(item: SNNote) {
|
||||||
|
this.item = item
|
||||||
|
}
|
||||||
|
|
||||||
deinit() {
|
deinit() {
|
||||||
if (this.saveTimeout) {
|
if (this.saveTimeout) {
|
||||||
clearTimeout(this.saveTimeout)
|
clearTimeout(this.saveTimeout)
|
||||||
|
|||||||
Reference in New Issue
Block a user