diff --git a/dist/index.js b/dist/index.js index 48bfda06..44907622 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1687,6 +1687,7 @@ }; close = () => { this.taskPageViewModel.closeBoard(); + this.taskViewModels.clear(); }; showSettings = () => { this.isPresentingSettingsModal.value = true; @@ -1723,11 +1724,11 @@ this.color.value = this.boardInfo.color; }; loadTasks = () => { - this.taskViewModels.clear(); const taskIds = this.boardModel.listTaskIds( this.boardInfo.fileId ); for (const taskId of taskIds) { + if (this.taskViewModels.value.has(taskId)) return; const taskFileContent = this.boardModel.getLatestTaskFileContent(taskId); if (taskFileContent == null) continue; const taskViewModel = new TaskViewModel( diff --git a/src/ViewModel/Pages/boardViewModel.ts b/src/ViewModel/Pages/boardViewModel.ts index c4f93b8d..6fc644d7 100644 --- a/src/ViewModel/Pages/boardViewModel.ts +++ b/src/ViewModel/Pages/boardViewModel.ts @@ -121,6 +121,7 @@ export default class BoardViewModel { close = (): void => { this.taskPageViewModel.closeBoard(); + this.taskViewModels.clear(); }; showSettings = (): void => { @@ -168,12 +169,12 @@ export default class BoardViewModel { }; loadTasks = (): void => { - this.taskViewModels.clear(); - const taskIds: string[] = this.boardModel.listTaskIds( this.boardInfo.fileId ); for (const taskId of taskIds) { + if (this.taskViewModels.value.has(taskId)) return; + const taskFileContent: TaskFileContent | null = this.boardModel.getLatestTaskFileContent(taskId); if (taskFileContent == null) continue;