diff --git a/dist/index.js b/dist/index.js index e2438ebc..b456e8d3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2246,7 +2246,7 @@ }; // src/ViewModel/Global/coreViewModel.ts - var CoreViewModel = class _CoreViewModel { + var CoreViewModel = class { // init constructor(storageModel2, settingsModel2, connectionModel2, chatListModel2, fileTransferModel2) { this.storageModel = storageModel2; @@ -2254,7 +2254,7 @@ this.connectionModel = connectionModel2; this.chatListModel = chatListModel2; this.fileTransferModel = fileTransferModel2; - this.BUILD = "Build 26.04.12.C"; + this.BUILD = "Build 26.04.13.A"; // CONTEXT this.contextStack = /* @__PURE__ */ new Map(); this.logContexts = () => { @@ -2275,7 +2275,6 @@ this.logContexts(); }; this.handleKeyDown = (e) => { - if (!_CoreViewModel.checkIsKeystroke(e)) return; const contexts = this.contexts; while (contexts.length > 0) { const currentContext = contexts.pop(); @@ -6067,6 +6066,7 @@ this.presentedModal.value = 4 /* TransferDataInput */; }; this.prepareReceivingData = () => { + if (this.cannotPrepareToReceive.value == true) return; this.presentedModal.value = 5 /* ReceptionDisplay */; this.filePathsReceived.clear(); const transferData = { @@ -6592,6 +6592,54 @@ // src/Model/Global/settingsModel.ts var SettingsModel = class _SettingsModel { + // init + constructor(storageModel2) { + this.setName = (newValue) => { + this.username = newValue; + this.storeSetting("username", newValue); + }; + this.setFirstDayOfWeek = (newValue) => { + this.firstDayOfWeek = newValue; + this.storeSetting("firstDayOfWeek", newValue); + }; + this.setLanguage = (newValue) => { + this.language = newValue; + this.storeSetting("language", newValue); + }; + this.setTheme = (newValue) => { + this.theme = newValue; + this.storeSetting("theme", newValue); + }; + // load + this.readSetting = (pathName) => { + const path = StorageModel.getPath( + "settings" /* SettingsModel */, + filePaths.settingsModel[pathName] + ); + return this.storageModel.read(path); + }; + this.loadUsername = () => { + const content = this.readSetting("username"); + this.username = content ?? ""; + }; + this.loadFirstDayofWeek = () => { + const content = this.readSetting("firstDayOfWeek"); + this.firstDayOfWeek = content ?? "0"; + }; + this.loadLanguage = () => { + const content = this.readSetting("language"); + this.language = content ?? _SettingsModel.getSystemLanguage(); + }; + this.loadTheme = () => { + const content = this.readSetting("theme"); + this.theme = content ?? "system" /* System */; + }; + this.storageModel = storageModel2; + this.loadUsername(); + this.loadFirstDayofWeek(); + this.loadLanguage(); + this.loadTheme(); + } // storage storeSetting(pathName, value) { const path = StorageModel.getPath( @@ -6600,54 +6648,6 @@ ); this.storageModel.write(path, value); } - setName(newValue) { - this.username = newValue; - this.storeSetting("username", newValue); - } - setFirstDayOfWeek(newValue) { - this.firstDayOfWeek = newValue; - this.storeSetting("firstDayOfWeek", newValue); - } - setLanguage(newValue) { - this.language = newValue; - this.storeSetting("language", newValue); - } - setTheme(newValue) { - this.theme = newValue; - this.storeSetting("theme", newValue); - } - // load - readSetting(pathName) { - const path = StorageModel.getPath( - "settings" /* SettingsModel */, - filePaths.settingsModel[pathName] - ); - return this.storageModel.read(path); - } - loadUsername() { - const content = this.readSetting("username"); - this.username = content ?? ""; - } - loadFirstDayofWeek() { - const content = this.readSetting("firstDayOfWeek"); - this.firstDayOfWeek = content ?? "0"; - } - loadLanguage() { - const content = this.readSetting("language"); - this.language = content ?? _SettingsModel.getSystemLanguage(); - } - loadTheme() { - const content = this.readSetting("theme"); - this.theme = content ?? "system" /* System */; - } - // init - constructor(storageModel2) { - this.storageModel = storageModel2; - this.loadUsername(); - this.loadFirstDayofWeek(); - this.loadLanguage(); - this.loadTheme(); - } static getSystemLanguage() { switch (navigator.language.substring(0, 2)) { case "de": diff --git a/src/Model/Chat/chatListModel.ts b/src/Model/Chat/chatListModel.ts index 0d4c1787..98322993 100644 --- a/src/Model/Chat/chatListModel.ts +++ b/src/Model/Chat/chatListModel.ts @@ -10,12 +10,12 @@ import SettingsModel from "../Global/settingsModel"; import { v4 } from "uuid"; export default class ChatListModel { - storageModel: StorageModel; - settingsModel: SettingsModel; - connectionModel: ConnectionModel; + readonly storageModel: StorageModel; + readonly settingsModel: SettingsModel; + readonly connectionModel: ConnectionModel; // data - chatModels: Set = new Set(); + chatModels = new Set(); // handlers messageHandler = (data: Message): void => { diff --git a/src/Model/Chat/chatModel.ts b/src/Model/Chat/chatModel.ts index c67fffba..653db858 100644 --- a/src/Model/Chat/chatModel.ts +++ b/src/Model/Chat/chatModel.ts @@ -26,21 +26,21 @@ import SettingsModel from "../Global/settingsModel"; import { v4 } from "uuid"; export default class ChatModel { - connectionModel: ConnectionModel; - storageModel: StorageModel; - settingsModel: SettingsModel; - chatListModel: ChatListModel; + readonly connectionModel: ConnectionModel; + readonly storageModel: StorageModel; + readonly settingsModel: SettingsModel; + readonly chatListModel: ChatListModel; - fileModel: FileModel; + readonly fileModel: FileModel; // data - id: string; + readonly id: string; info: ChatInfo; color: Colors; chatMessageHandlerManager: HandlerManager = new HandlerManager(); - reactionHandlerManager: HandlerManager = + readonly reactionHandlerManager: HandlerManager = new HandlerManager(); get secondaryChannels(): string[] { @@ -459,12 +459,12 @@ export enum ChatMessageStatuses { } export interface ChatMessage extends ValidObject { - id: string; + readonly id: string; - channel: string; - sender: string; + readonly channel: string; + readonly sender: string; body: string; - dateSent: string; + readonly dateSent: string; status: ChatMessageStatuses; @@ -473,9 +473,9 @@ export interface ChatMessage extends ValidObject { export interface ChatMessageReaction extends ValidObject, FileContent<"reaction"> { - messageId: string; - sender: string; - content: ReactionSymbols | string; + readonly messageId: string; + readonly sender: string; + readonly content: ReactionSymbols | string; isDeleting: boolean; } diff --git a/src/Model/Files/boardsAndTasksModel.ts b/src/Model/Files/boardsAndTasksModel.ts index 01c9d5f1..3ef1fd6d 100644 --- a/src/Model/Files/boardsAndTasksModel.ts +++ b/src/Model/Files/boardsAndTasksModel.ts @@ -15,16 +15,16 @@ import StorageModel from "../Global/storageModel"; import { v4 } from "uuid"; export default class BoardsAndTasksModel { - storageModel: StorageModel; - settingsModel: SettingsModel; - chatModel: ChatModel; - fileModel: FileModel; + readonly storageModel: StorageModel; + readonly settingsModel: SettingsModel; + readonly chatModel: ChatModel; + readonly fileModel: FileModel; - calendarModel: CalendarModel; + readonly calendarModel: CalendarModel; // data - boardHandlerManager = new HandlerManager(); - taskHandlerManager = new HandlerManager(); + readonly boardHandlerManager = new HandlerManager(); + readonly taskHandlerManager = new HandlerManager(); // paths getBasePath = (): string[] => { diff --git a/src/Model/Files/calendarModel.ts b/src/Model/Files/calendarModel.ts index 1432be16..32584f35 100644 --- a/src/Model/Files/calendarModel.ts +++ b/src/Model/Files/calendarModel.ts @@ -7,9 +7,9 @@ import StorageModel from "../Global/storageModel"; import { TaskFileContent } from "./boardsAndTasksModel"; export default class CalendarModel { - storageModel: StorageModel; - fileModel: FileModel; - settingsModel: SettingsModel; + readonly storageModel: StorageModel; + readonly fileModel: FileModel; + readonly settingsModel: SettingsModel; // paths getBasePath = (): string[] => { @@ -155,12 +155,12 @@ export enum CalendarModelSubPaths { // types export interface MonthGrid { - offset: number; - firstDayOfWeek: number; - isCurrentMonth: boolean; + readonly offset: number; + readonly firstDayOfWeek: number; + readonly isCurrentMonth: boolean; - year: number; - month: number; + readonly year: number; + readonly month: number; - days: { [date: string]: T }; + readonly days: { [date: string]: T }; } diff --git a/src/Model/Files/fileModel.ts b/src/Model/Files/fileModel.ts index 61c3a431..a6ea82e3 100644 --- a/src/Model/Files/fileModel.ts +++ b/src/Model/Files/fileModel.ts @@ -18,11 +18,11 @@ import SettingsModel from "../Global/settingsModel"; import { v4 } from "uuid"; export default class FileModel { - storageModel: StorageModel; - settingsModel: SettingsModel; + readonly storageModel: StorageModel; + readonly settingsModel: SettingsModel; - chatModel: ChatModel; - boardsAndTasksModel: BoardsAndTasksModel; + readonly chatModel: ChatModel; + readonly boardsAndTasksModel: BoardsAndTasksModel; // paths getBasePath = (): string[] => { @@ -193,11 +193,11 @@ export enum FileModelSubPath { // types export interface FileContent extends ValidObject, StringEntryObject { - fileId: string; - fileContentId: string; - creationDate: string; + readonly fileId: string; + readonly fileContentId: string; + readonly creationDate: string; - type: T; + readonly type: T; } // references diff --git a/src/Model/Global/connectionModel.ts b/src/Model/Global/connectionModel.ts index b630b812..570564c5 100644 --- a/src/Model/Global/connectionModel.ts +++ b/src/Model/Global/connectionModel.ts @@ -6,8 +6,8 @@ import StorageModel, { StorageModelSubPaths, filePaths } from "./storageModel"; import UDNFrontend, { Message } from "udn-frontend"; export default class ConnectionModel { - udn: UDNFrontend; - storageModel: StorageModel; + readonly udn: UDNFrontend; + readonly storageModel: StorageModel; reconnectInterval: number | undefined = undefined; shouldAttemptReconnect: boolean = false; @@ -20,10 +20,10 @@ export default class ConnectionModel { return this.udn.ws?.url; } - connectionChangeHandlerManager = new HandlerManager(); - messageHandlerManager = new HandlerManager(); - messageSentHandlerManager = new HandlerManager(); - channelsToSubscribe = new Set(); + readonly connectionChangeHandlerManager = new HandlerManager(); + readonly messageHandlerManager = new HandlerManager(); + readonly messageSentHandlerManager = new HandlerManager(); + readonly channelsToSubscribe = new Set(); // handlers handleMessage = (data: Message): void => { diff --git a/src/Model/Global/fileTransferModel.ts b/src/Model/Global/fileTransferModel.ts index ab57c02f..e3cdc62f 100644 --- a/src/Model/Global/fileTransferModel.ts +++ b/src/Model/Global/fileTransferModel.ts @@ -14,15 +14,15 @@ import StorageModel from "./storageModel"; import { checkMatchesObjectStructure } from "../Utility/typeSafety"; export default class FileTransferModel { - storageModel: StorageModel; - connectionModel: ConnectionModel; + readonly storageModel: StorageModel; + readonly connectionModel: ConnectionModel; static READY_MESSAGE = "ready"; // data - transferData: TransferData | undefined = undefined; - fileHandlerManager = new HandlerManager(); - readyToSendHandlerManager = new HandlerManager(); + transferData: TransferData | undefined; + readonly fileHandlerManager = new HandlerManager(); + readonly readyToSendHandlerManager = new HandlerManager(); direction: TransferDirections = TransferDirections.Send; // general @@ -140,8 +140,8 @@ export default class FileTransferModel { } export interface TransferData { - channel: string; - key: string; + readonly channel: string; + readonly key: string; } export interface FileData { diff --git a/src/Model/Global/settingsModel.ts b/src/Model/Global/settingsModel.ts index 73998607..828e1770 100644 --- a/src/Model/Global/settingsModel.ts +++ b/src/Model/Global/settingsModel.ts @@ -3,7 +3,7 @@ import StorageModel, { StorageModelSubPaths, filePaths } from "./storageModel"; export default class SettingsModel { - storageModel: StorageModel; + readonly storageModel: StorageModel; // data username: string; diff --git a/src/ViewModel/Chat/chatListViewModel.ts b/src/ViewModel/Chat/chatListViewModel.ts index 56e23812..8f350cce 100644 --- a/src/ViewModel/Chat/chatListViewModel.ts +++ b/src/ViewModel/Chat/chatListViewModel.ts @@ -14,7 +14,7 @@ export default class ChatListViewModel { notificationViewModel: NotificationViewModel; // data - chatIndexManager = new IndexManager( + readonly chatIndexManager = new IndexManager( (chatViewModel: ChatViewModel) => chatViewModel.settingsPageViewModel.primaryChannel.value, ); @@ -96,9 +96,9 @@ export default class ChatListViewModel { // init constructor( - public coreViewModel: CoreViewModel, - public settingsViewModel: SettingsViewModel, - public connectionViewModel: ConnectionViewModel, + public readonly coreViewModel: CoreViewModel, + public readonly settingsViewModel: SettingsViewModel, + public readonly connectionViewModel: ConnectionViewModel, ) { this.notificationViewModel = new NotificationViewModel(this); diff --git a/src/ViewModel/Chat/chatMessageViewModel.ts b/src/ViewModel/Chat/chatMessageViewModel.ts index 71bb7842..6a7f8092 100644 --- a/src/ViewModel/Chat/chatMessageViewModel.ts +++ b/src/ViewModel/Chat/chatMessageViewModel.ts @@ -123,8 +123,8 @@ export default class ChatMessageViewModel { // init constructor( - public coreViewModel: CoreViewModel, - public messagePageViewModel: MessagePageViewModel, + public readonly coreViewModel: CoreViewModel, + public readonly messagePageViewModel: MessagePageViewModel, chatMessage: ChatMessage, sentByUser: boolean, ) { diff --git a/src/ViewModel/Chat/chatViewModel.ts b/src/ViewModel/Chat/chatViewModel.ts index 7c88482d..b9fccba4 100644 --- a/src/ViewModel/Chat/chatViewModel.ts +++ b/src/ViewModel/Chat/chatViewModel.ts @@ -145,12 +145,12 @@ export default class ChatViewModel extends ContextHost { // init constructor( - public coreViewModel: CoreViewModel, - public chatModel: ChatModel, - public settingsViewModel: SettingsViewModel, - public notificationViewModel: NotificationViewModel, - public connectionViewModel: ConnectionViewModel, - public chatListViewModel: ChatListViewModel, + public readonly coreViewModel: CoreViewModel, + public readonly chatModel: ChatModel, + public readonly settingsViewModel: SettingsViewModel, + public readonly notificationViewModel: NotificationViewModel, + public readonly connectionViewModel: ConnectionViewModel, + public readonly chatListViewModel: ChatListViewModel, ) { super(); diff --git a/src/ViewModel/Global/connectionViewModel.ts b/src/ViewModel/Global/connectionViewModel.ts index d8a712e3..6a8da2dd 100644 --- a/src/ViewModel/Global/connectionViewModel.ts +++ b/src/ViewModel/Global/connectionViewModel.ts @@ -87,7 +87,7 @@ export default class ConnectionViewModel { }; // init - constructor(public coreViewModel: CoreViewModel) { + constructor(public readonly coreViewModel: CoreViewModel) { this.updatePreviousAddresses(); coreViewModel.connectionModel.connectionChangeHandlerManager.addHandler( diff --git a/src/ViewModel/Global/coreViewModel.ts b/src/ViewModel/Global/coreViewModel.ts index 1e7ddf58..8b6a70fd 100644 --- a/src/ViewModel/Global/coreViewModel.ts +++ b/src/ViewModel/Global/coreViewModel.ts @@ -66,11 +66,11 @@ export default class CoreViewModel { // init constructor( - public storageModel: StorageModel, - public settingsModel: SettingsModel, - public connectionModel: ConnectionModel, - public chatListModel: ChatListModel, - public fileTransferModel: FileTransferModel, + public readonly storageModel: StorageModel, + public readonly settingsModel: SettingsModel, + public readonly connectionModel: ConnectionModel, + public readonly chatListModel: ChatListModel, + public readonly fileTransferModel: FileTransferModel, ) { this.translations = allTranslations[settingsModel.language] || allTranslations.en; diff --git a/src/ViewModel/Global/fileTransferViewModel.ts b/src/ViewModel/Global/fileTransferViewModel.ts index dd620fbc..7ec53498 100644 --- a/src/ViewModel/Global/fileTransferViewModel.ts +++ b/src/ViewModel/Global/fileTransferViewModel.ts @@ -13,7 +13,7 @@ import CoreViewModel, { Context } from "./coreViewModel"; import { CommonKeys } from "../../View/keystrokes"; export default class FileTransferViewModel extends Context { - contextDebugDescription: string = "transfer"; + contextDebugDescription = "transfer"; // state presentedModal: React.State = @@ -172,7 +172,7 @@ export default class FileTransferViewModel extends Context { }; // init - constructor(public coreViewModel: CoreViewModel) { + constructor(public readonly coreViewModel: CoreViewModel) { super(); this.coreViewModel.fileTransferModel.fileHandlerManager.addHandler( diff --git a/src/ViewModel/Global/notificationViewModel.ts b/src/ViewModel/Global/notificationViewModel.ts index fe186893..b1872a71 100644 --- a/src/ViewModel/Global/notificationViewModel.ts +++ b/src/ViewModel/Global/notificationViewModel.ts @@ -76,7 +76,7 @@ export default class NotificationViewModel { }; // init - constructor(public chatListViewModel: ChatListViewModel) {} + constructor(public readonly chatListViewModel: ChatListViewModel) {} // util static createNotification(message: ChatMessage): Notification { diff --git a/src/ViewModel/Global/settingsViewModel.ts b/src/ViewModel/Global/settingsViewModel.ts index 301c2dbd..aba94752 100644 --- a/src/ViewModel/Global/settingsViewModel.ts +++ b/src/ViewModel/Global/settingsViewModel.ts @@ -5,7 +5,7 @@ import { Languages, ThemeSettings } from "../../Model/Global/settingsModel"; import { CommonKeys } from "../../View/keystrokes"; export default class SettingsViewModel extends Context { - contextDebugDescription: string = "settings"; + contextDebugDescription = "settings"; // state username: React.State = new React.State(""); @@ -72,7 +72,7 @@ export default class SettingsViewModel extends Context { }; // init - constructor(public coreViewModel: CoreViewModel) { + constructor(public readonly coreViewModel: CoreViewModel) { super(); this.username.value = coreViewModel.settingsModel.username; diff --git a/src/ViewModel/Global/storageViewModel.ts b/src/ViewModel/Global/storageViewModel.ts index 2723c2b3..2cc27d09 100644 --- a/src/ViewModel/Global/storageViewModel.ts +++ b/src/ViewModel/Global/storageViewModel.ts @@ -65,7 +65,7 @@ export default class StorageViewModel extends Context { }; // init - constructor(public coreViewModel: CoreViewModel) { + constructor(public readonly coreViewModel: CoreViewModel) { super(); this.selectedFileName = React.createProxyState( diff --git a/src/ViewModel/Pages/boardViewModel.ts b/src/ViewModel/Pages/boardViewModel.ts index f2fbf36b..8af8914a 100644 --- a/src/ViewModel/Pages/boardViewModel.ts +++ b/src/ViewModel/Pages/boardViewModel.ts @@ -16,7 +16,7 @@ import TaskViewModel from "./taskViewModel"; import { CommonKeys } from "../../View/keystrokes"; export default class BoardViewModel extends TaskContainingPageViewModel { - contextDebugDescription: string = "board"; + contextDebugDescription = "board"; // state name: React.State = new React.State(""); @@ -247,11 +247,11 @@ export default class BoardViewModel extends TaskContainingPageViewModel { // init constructor( - public coreViewModel: CoreViewModel, - public chatViewModel: ChatViewModel, - public boardsAndTasksModel: BoardsAndTasksModel, - public taskPageViewModel: TaskPageViewModel, - public boardInfo: BoardInfoFileContent, + public readonly coreViewModel: CoreViewModel, + public readonly chatViewModel: ChatViewModel, + public readonly boardsAndTasksModel: BoardsAndTasksModel, + public readonly taskPageViewModel: TaskPageViewModel, + public readonly boardInfo: BoardInfoFileContent, ) { super(coreViewModel, chatViewModel, boardsAndTasksModel); diff --git a/src/ViewModel/Pages/calendarPageViewModel.ts b/src/ViewModel/Pages/calendarPageViewModel.ts index 257f4dc0..c63425e5 100644 --- a/src/ViewModel/Pages/calendarPageViewModel.ts +++ b/src/ViewModel/Pages/calendarPageViewModel.ts @@ -185,10 +185,10 @@ export default class CalendarPageViewModel extends TaskContainingPageViewModel { // init constructor( - public coreViewModel: CoreViewModel, - public chatViewModel: ChatViewModel, - public calendarModel: CalendarModel, - public boardsAndTasksModel: BoardsAndTasksModel, + public readonly coreViewModel: CoreViewModel, + public readonly chatViewModel: ChatViewModel, + public readonly calendarModel: CalendarModel, + public readonly boardsAndTasksModel: BoardsAndTasksModel, ) { super(coreViewModel, chatViewModel, boardsAndTasksModel); diff --git a/src/ViewModel/Pages/homeViewModel.ts b/src/ViewModel/Pages/homeViewModel.ts index f8c34455..b5a5a741 100644 --- a/src/ViewModel/Pages/homeViewModel.ts +++ b/src/ViewModel/Pages/homeViewModel.ts @@ -9,11 +9,11 @@ export default class HomeViewModel extends Context { contextDebugDescription = "home"; constructor( - public coreViewModel: CoreViewModel, - public settingsViewModel: SettingsViewModel, - public fileTransferViewModel: FileTransferViewModel, - public storageViewModel: StorageViewModel, - public connectionViewModel: ConnectionViewModel, + public readonly coreViewModel: CoreViewModel, + public readonly settingsViewModel: SettingsViewModel, + public readonly fileTransferViewModel: FileTransferViewModel, + public readonly storageViewModel: StorageViewModel, + public readonly connectionViewModel: ConnectionViewModel, ) { super(); diff --git a/src/ViewModel/Pages/messagePageViewModel.ts b/src/ViewModel/Pages/messagePageViewModel.ts index 085394f2..a8e9bf69 100644 --- a/src/ViewModel/Pages/messagePageViewModel.ts +++ b/src/ViewModel/Pages/messagePageViewModel.ts @@ -127,8 +127,8 @@ export default class MessagePageViewModel extends Context { // init constructor( - public coreViewModel: CoreViewModel, - public chatViewModel: ChatViewModel, + public readonly coreViewModel: CoreViewModel, + public readonly chatViewModel: ChatViewModel, ) { super(); diff --git a/src/ViewModel/Pages/settingsPageViewModel.ts b/src/ViewModel/Pages/settingsPageViewModel.ts index d6c771a0..ac19b879 100644 --- a/src/ViewModel/Pages/settingsPageViewModel.ts +++ b/src/ViewModel/Pages/settingsPageViewModel.ts @@ -112,8 +112,8 @@ export default class SettingsPageViewModel extends Context { // init constructor( - public coreViewModel: CoreViewModel, - public chatViewModel: ChatViewModel, + public readonly coreViewModel: CoreViewModel, + public readonly chatViewModel: ChatViewModel, ) { super(); diff --git a/src/ViewModel/Pages/taskContainingPageViewModel.ts b/src/ViewModel/Pages/taskContainingPageViewModel.ts index 226a5d16..86e9c0a8 100644 --- a/src/ViewModel/Pages/taskContainingPageViewModel.ts +++ b/src/ViewModel/Pages/taskContainingPageViewModel.ts @@ -11,7 +11,7 @@ import TaskViewModel from "./taskViewModel"; export default class TaskContainingPageViewModel extends Context { // state - taskIndexManager = new IndexManager( + readonly taskIndexManager = new IndexManager( (taskViewModel: TaskViewModel) => taskViewModel.sortingString, ); @@ -56,9 +56,9 @@ export default class TaskContainingPageViewModel extends Context { // init constructor( - public coreViewModel: CoreViewModel, - public chatViewModel: ChatViewModel, - public boardsAndTasksModel: BoardsAndTasksModel, + public readonly coreViewModel: CoreViewModel, + public readonly chatViewModel: ChatViewModel, + public readonly boardsAndTasksModel: BoardsAndTasksModel, ) { super(); } diff --git a/src/ViewModel/Pages/taskPageViewModel.ts b/src/ViewModel/Pages/taskPageViewModel.ts index 889348d3..6696bb1a 100644 --- a/src/ViewModel/Pages/taskPageViewModel.ts +++ b/src/ViewModel/Pages/taskPageViewModel.ts @@ -11,10 +11,10 @@ import { IndexManager } from "../../Model/Utility/utility"; import { CommonKeys } from "../../View/keystrokes"; export default class TaskPageViewModel extends ContextHost { - contextDebugDescription: string = "task-page"; + contextDebugDescription = "task-page"; // data - boardIndexManager = new IndexManager( + readonly boardIndexManager = new IndexManager( (boardViewModel: BoardViewModel) => boardViewModel.name.value, ); @@ -162,9 +162,9 @@ export default class TaskPageViewModel extends ContextHost { // init constructor( - public coreViewModel: CoreViewModel, - public chatViewModel: ChatViewModel, - public boardsAndTasksModel: BoardsAndTasksModel, + public readonly coreViewModel: CoreViewModel, + public readonly chatViewModel: ChatViewModel, + public readonly boardsAndTasksModel: BoardsAndTasksModel, ) { super(); diff --git a/src/ViewModel/Pages/taskViewModel.ts b/src/ViewModel/Pages/taskViewModel.ts index 6f13dfdd..3367d5f5 100644 --- a/src/ViewModel/Pages/taskViewModel.ts +++ b/src/ViewModel/Pages/taskViewModel.ts @@ -210,10 +210,10 @@ export default class TaskViewModel extends Context { // init constructor( - public coreViewModel: CoreViewModel, - public chatViewModel: ChatViewModel, - public boardsAndTasksModel: BoardsAndTasksModel, - public containingModel: TaskContainingPageViewModel, + public readonly coreViewModel: CoreViewModel, + public readonly chatViewModel: ChatViewModel, + public readonly boardsAndTasksModel: BoardsAndTasksModel, + public readonly containingModel: TaskContainingPageViewModel, public task: TaskFileContent, ) { super(); diff --git a/src/ViewModel/Utility/taskPropertyBulkChangeViewModel.ts b/src/ViewModel/Utility/taskPropertyBulkChangeViewModel.ts index 07d1882f..3729159c 100644 --- a/src/ViewModel/Utility/taskPropertyBulkChangeViewModel.ts +++ b/src/ViewModel/Utility/taskPropertyBulkChangeViewModel.ts @@ -19,7 +19,7 @@ export default class TaskPropertyBulkChangeViewModel { }); }; - setValue: (newValue: string, taskViewModel: TaskViewModel) => void = () => {}; + setValue: (newValue: string, taskViewModel: TaskViewModel) => void; // init constructor(