diff --git a/dist/index.js b/dist/index.js index 25a6349c..1b87150d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3123,7 +3123,7 @@ this.chatViewModel.chatListViewModel.untrackChat(this.chatViewModel); }; // load - this.loadListRelevantData = () => { + this.preloadData = () => { this.primaryChannel.value = this.chatViewModel.chatModel.info.primaryChannel; this.color.value = this.chatViewModel.chatModel.color; }; @@ -3138,7 +3138,7 @@ this.secondaryChannels.add(secondaryChannel); } }; - this.loadListRelevantData(); + this.preloadData(); this.cannotSetEncryptionKey = createProxyState( [this.encryptionKeyInput], () => this.encryptionKeyInput.value == this.chatViewModel.chatModel.info.encryptionKey @@ -3296,7 +3296,7 @@ this.index.value = index; }; // load - this.loadListRelevantData = () => { + this.preloadData = () => { this.name.value = this.boardInfo.name; this.color.value = this.boardInfo.color; }; @@ -3336,8 +3336,7 @@ this.loadTasks(); this.loadSearchSuggestions(); }; - console.log("NEW BOARD VM"); - this.loadListRelevantData(); + this.preloadData(); this.isSelected = createProxyState( [this.taskPageViewModel.selectedBoardId], () => this.taskPageViewModel.selectedBoardId.value == this.boardInfo.fileId @@ -3509,6 +3508,7 @@ this.updateBoardIndices(); this.openLastUsedBoard(); }; + this.loadData(); this.chatViewModel = chatViewModel; this.chatViewModel.registerContext("tasks" /* Tasks */, this); this.selectedBoardId.subscribeSilent(this.updateContexts); diff --git a/src/ViewModel/Pages/boardViewModel.ts b/src/ViewModel/Pages/boardViewModel.ts index 39a7295d..bff8c069 100644 --- a/src/ViewModel/Pages/boardViewModel.ts +++ b/src/ViewModel/Pages/boardViewModel.ts @@ -195,7 +195,7 @@ export default class BoardViewModel extends TaskContainingPageViewModel { }; // load - loadListRelevantData = (): void => { + preloadData = (): void => { this.name.value = this.boardInfo.name; this.color.value = this.boardInfo.color; }; @@ -255,10 +255,9 @@ export default class BoardViewModel extends TaskContainingPageViewModel { public readonly boardInfo: BoardInfoFileContent, ) { super(coreViewModel, chatViewModel, boardsAndTasksModel, "board"); - console.log("NEW BOARD VM") // load - this.loadListRelevantData(); + this.preloadData(); // subscriptions this.isSelected = React.createProxyState( diff --git a/src/ViewModel/Pages/settingsPageViewModel.ts b/src/ViewModel/Pages/settingsPageViewModel.ts index 1a9c0312..2c7c6c07 100644 --- a/src/ViewModel/Pages/settingsPageViewModel.ts +++ b/src/ViewModel/Pages/settingsPageViewModel.ts @@ -83,7 +83,7 @@ export default class SettingsPageViewModel extends Context { }; // load - loadListRelevantData = (): void => { + preloadData = (): void => { this.primaryChannel.value = this.chatViewModel.chatModel.info.primaryChannel; @@ -115,7 +115,7 @@ export default class SettingsPageViewModel extends Context { ) { super("settings"); - this.loadListRelevantData(); + this.preloadData(); this.cannotSetEncryptionKey = React.createProxyState( [this.encryptionKeyInput], diff --git a/src/ViewModel/Pages/taskPageViewModel.ts b/src/ViewModel/Pages/taskPageViewModel.ts index ef9303d1..e0aee8de 100644 --- a/src/ViewModel/Pages/taskPageViewModel.ts +++ b/src/ViewModel/Pages/taskPageViewModel.ts @@ -174,6 +174,8 @@ export default class TaskPageViewModel extends ContextHost { ) { super("task-page"); + this.loadData(); // needed for board options in calendar + this.chatViewModel = chatViewModel; // context