add readonly keyword where applicable - AI
This commit is contained in:
Vendored
+51
-51
@@ -2246,7 +2246,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// src/ViewModel/Global/coreViewModel.ts
|
// src/ViewModel/Global/coreViewModel.ts
|
||||||
var CoreViewModel = class _CoreViewModel {
|
var CoreViewModel = class {
|
||||||
// init
|
// init
|
||||||
constructor(storageModel2, settingsModel2, connectionModel2, chatListModel2, fileTransferModel2) {
|
constructor(storageModel2, settingsModel2, connectionModel2, chatListModel2, fileTransferModel2) {
|
||||||
this.storageModel = storageModel2;
|
this.storageModel = storageModel2;
|
||||||
@@ -2254,7 +2254,7 @@
|
|||||||
this.connectionModel = connectionModel2;
|
this.connectionModel = connectionModel2;
|
||||||
this.chatListModel = chatListModel2;
|
this.chatListModel = chatListModel2;
|
||||||
this.fileTransferModel = fileTransferModel2;
|
this.fileTransferModel = fileTransferModel2;
|
||||||
this.BUILD = "Build 26.04.12.C";
|
this.BUILD = "Build 26.04.13.A";
|
||||||
// CONTEXT
|
// CONTEXT
|
||||||
this.contextStack = /* @__PURE__ */ new Map();
|
this.contextStack = /* @__PURE__ */ new Map();
|
||||||
this.logContexts = () => {
|
this.logContexts = () => {
|
||||||
@@ -2275,7 +2275,6 @@
|
|||||||
this.logContexts();
|
this.logContexts();
|
||||||
};
|
};
|
||||||
this.handleKeyDown = (e) => {
|
this.handleKeyDown = (e) => {
|
||||||
if (!_CoreViewModel.checkIsKeystroke(e)) return;
|
|
||||||
const contexts = this.contexts;
|
const contexts = this.contexts;
|
||||||
while (contexts.length > 0) {
|
while (contexts.length > 0) {
|
||||||
const currentContext = contexts.pop();
|
const currentContext = contexts.pop();
|
||||||
@@ -6067,6 +6066,7 @@
|
|||||||
this.presentedModal.value = 4 /* TransferDataInput */;
|
this.presentedModal.value = 4 /* TransferDataInput */;
|
||||||
};
|
};
|
||||||
this.prepareReceivingData = () => {
|
this.prepareReceivingData = () => {
|
||||||
|
if (this.cannotPrepareToReceive.value == true) return;
|
||||||
this.presentedModal.value = 5 /* ReceptionDisplay */;
|
this.presentedModal.value = 5 /* ReceptionDisplay */;
|
||||||
this.filePathsReceived.clear();
|
this.filePathsReceived.clear();
|
||||||
const transferData = {
|
const transferData = {
|
||||||
@@ -6592,6 +6592,54 @@
|
|||||||
|
|
||||||
// src/Model/Global/settingsModel.ts
|
// src/Model/Global/settingsModel.ts
|
||||||
var SettingsModel = class _SettingsModel {
|
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
|
// storage
|
||||||
storeSetting(pathName, value) {
|
storeSetting(pathName, value) {
|
||||||
const path = StorageModel.getPath(
|
const path = StorageModel.getPath(
|
||||||
@@ -6600,54 +6648,6 @@
|
|||||||
);
|
);
|
||||||
this.storageModel.write(path, value);
|
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() {
|
static getSystemLanguage() {
|
||||||
switch (navigator.language.substring(0, 2)) {
|
switch (navigator.language.substring(0, 2)) {
|
||||||
case "de":
|
case "de":
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ import SettingsModel from "../Global/settingsModel";
|
|||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
export default class ChatListModel {
|
export default class ChatListModel {
|
||||||
storageModel: StorageModel;
|
readonly storageModel: StorageModel;
|
||||||
settingsModel: SettingsModel;
|
readonly settingsModel: SettingsModel;
|
||||||
connectionModel: ConnectionModel;
|
readonly connectionModel: ConnectionModel;
|
||||||
|
|
||||||
// data
|
// data
|
||||||
chatModels: Set<ChatModel> = new Set<ChatModel>();
|
chatModels = new Set<ChatModel>();
|
||||||
|
|
||||||
// handlers
|
// handlers
|
||||||
messageHandler = (data: Message): void => {
|
messageHandler = (data: Message): void => {
|
||||||
|
|||||||
+14
-14
@@ -26,21 +26,21 @@ import SettingsModel from "../Global/settingsModel";
|
|||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
export default class ChatModel {
|
export default class ChatModel {
|
||||||
connectionModel: ConnectionModel;
|
readonly connectionModel: ConnectionModel;
|
||||||
storageModel: StorageModel;
|
readonly storageModel: StorageModel;
|
||||||
settingsModel: SettingsModel;
|
readonly settingsModel: SettingsModel;
|
||||||
chatListModel: ChatListModel;
|
readonly chatListModel: ChatListModel;
|
||||||
|
|
||||||
fileModel: FileModel;
|
readonly fileModel: FileModel;
|
||||||
|
|
||||||
// data
|
// data
|
||||||
id: string;
|
readonly id: string;
|
||||||
info: ChatInfo;
|
info: ChatInfo;
|
||||||
color: Colors;
|
color: Colors;
|
||||||
|
|
||||||
chatMessageHandlerManager: HandlerManager<ChatMessage> =
|
chatMessageHandlerManager: HandlerManager<ChatMessage> =
|
||||||
new HandlerManager();
|
new HandlerManager();
|
||||||
reactionHandlerManager: HandlerManager<ChatMessageReaction> =
|
readonly reactionHandlerManager: HandlerManager<ChatMessageReaction> =
|
||||||
new HandlerManager();
|
new HandlerManager();
|
||||||
|
|
||||||
get secondaryChannels(): string[] {
|
get secondaryChannels(): string[] {
|
||||||
@@ -459,12 +459,12 @@ export enum ChatMessageStatuses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ChatMessage extends ValidObject {
|
export interface ChatMessage extends ValidObject {
|
||||||
id: string;
|
readonly id: string;
|
||||||
|
|
||||||
channel: string;
|
readonly channel: string;
|
||||||
sender: string;
|
readonly sender: string;
|
||||||
body: string;
|
body: string;
|
||||||
dateSent: string;
|
readonly dateSent: string;
|
||||||
|
|
||||||
status: ChatMessageStatuses;
|
status: ChatMessageStatuses;
|
||||||
|
|
||||||
@@ -473,9 +473,9 @@ export interface ChatMessage extends ValidObject {
|
|||||||
|
|
||||||
export interface ChatMessageReaction
|
export interface ChatMessageReaction
|
||||||
extends ValidObject, FileContent<"reaction"> {
|
extends ValidObject, FileContent<"reaction"> {
|
||||||
messageId: string;
|
readonly messageId: string;
|
||||||
sender: string;
|
readonly sender: string;
|
||||||
content: ReactionSymbols | string;
|
readonly content: ReactionSymbols | string;
|
||||||
isDeleting: boolean;
|
isDeleting: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,16 +15,16 @@ import StorageModel from "../Global/storageModel";
|
|||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
export default class BoardsAndTasksModel {
|
export default class BoardsAndTasksModel {
|
||||||
storageModel: StorageModel;
|
readonly storageModel: StorageModel;
|
||||||
settingsModel: SettingsModel;
|
readonly settingsModel: SettingsModel;
|
||||||
chatModel: ChatModel;
|
readonly chatModel: ChatModel;
|
||||||
fileModel: FileModel;
|
readonly fileModel: FileModel;
|
||||||
|
|
||||||
calendarModel: CalendarModel;
|
readonly calendarModel: CalendarModel;
|
||||||
|
|
||||||
// data
|
// data
|
||||||
boardHandlerManager = new HandlerManager<BoardInfoFileContent>();
|
readonly boardHandlerManager = new HandlerManager<BoardInfoFileContent>();
|
||||||
taskHandlerManager = new HandlerManager<TaskFileContent>();
|
readonly taskHandlerManager = new HandlerManager<TaskFileContent>();
|
||||||
|
|
||||||
// paths
|
// paths
|
||||||
getBasePath = (): string[] => {
|
getBasePath = (): string[] => {
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import StorageModel from "../Global/storageModel";
|
|||||||
import { TaskFileContent } from "./boardsAndTasksModel";
|
import { TaskFileContent } from "./boardsAndTasksModel";
|
||||||
|
|
||||||
export default class CalendarModel {
|
export default class CalendarModel {
|
||||||
storageModel: StorageModel;
|
readonly storageModel: StorageModel;
|
||||||
fileModel: FileModel;
|
readonly fileModel: FileModel;
|
||||||
settingsModel: SettingsModel;
|
readonly settingsModel: SettingsModel;
|
||||||
|
|
||||||
// paths
|
// paths
|
||||||
getBasePath = (): string[] => {
|
getBasePath = (): string[] => {
|
||||||
@@ -155,12 +155,12 @@ export enum CalendarModelSubPaths {
|
|||||||
|
|
||||||
// types
|
// types
|
||||||
export interface MonthGrid<T> {
|
export interface MonthGrid<T> {
|
||||||
offset: number;
|
readonly offset: number;
|
||||||
firstDayOfWeek: number;
|
readonly firstDayOfWeek: number;
|
||||||
isCurrentMonth: boolean;
|
readonly isCurrentMonth: boolean;
|
||||||
|
|
||||||
year: number;
|
readonly year: number;
|
||||||
month: number;
|
readonly month: number;
|
||||||
|
|
||||||
days: { [date: string]: T };
|
readonly days: { [date: string]: T };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ import SettingsModel from "../Global/settingsModel";
|
|||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
export default class FileModel {
|
export default class FileModel {
|
||||||
storageModel: StorageModel;
|
readonly storageModel: StorageModel;
|
||||||
settingsModel: SettingsModel;
|
readonly settingsModel: SettingsModel;
|
||||||
|
|
||||||
chatModel: ChatModel;
|
readonly chatModel: ChatModel;
|
||||||
boardsAndTasksModel: BoardsAndTasksModel;
|
readonly boardsAndTasksModel: BoardsAndTasksModel;
|
||||||
|
|
||||||
// paths
|
// paths
|
||||||
getBasePath = (): string[] => {
|
getBasePath = (): string[] => {
|
||||||
@@ -193,11 +193,11 @@ export enum FileModelSubPath {
|
|||||||
// types
|
// types
|
||||||
export interface FileContent<T extends string>
|
export interface FileContent<T extends string>
|
||||||
extends ValidObject, StringEntryObject {
|
extends ValidObject, StringEntryObject {
|
||||||
fileId: string;
|
readonly fileId: string;
|
||||||
fileContentId: string;
|
readonly fileContentId: string;
|
||||||
creationDate: string;
|
readonly creationDate: string;
|
||||||
|
|
||||||
type: T;
|
readonly type: T;
|
||||||
}
|
}
|
||||||
|
|
||||||
// references
|
// references
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import StorageModel, { StorageModelSubPaths, filePaths } from "./storageModel";
|
|||||||
import UDNFrontend, { Message } from "udn-frontend";
|
import UDNFrontend, { Message } from "udn-frontend";
|
||||||
|
|
||||||
export default class ConnectionModel {
|
export default class ConnectionModel {
|
||||||
udn: UDNFrontend;
|
readonly udn: UDNFrontend;
|
||||||
storageModel: StorageModel;
|
readonly storageModel: StorageModel;
|
||||||
reconnectInterval: number | undefined = undefined;
|
reconnectInterval: number | undefined = undefined;
|
||||||
shouldAttemptReconnect: boolean = false;
|
shouldAttemptReconnect: boolean = false;
|
||||||
|
|
||||||
@@ -20,10 +20,10 @@ export default class ConnectionModel {
|
|||||||
return this.udn.ws?.url;
|
return this.udn.ws?.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
connectionChangeHandlerManager = new HandlerManager<void>();
|
readonly connectionChangeHandlerManager = new HandlerManager<void>();
|
||||||
messageHandlerManager = new HandlerManager<Message>();
|
readonly messageHandlerManager = new HandlerManager<Message>();
|
||||||
messageSentHandlerManager = new HandlerManager<ChatMessage>();
|
readonly messageSentHandlerManager = new HandlerManager<ChatMessage>();
|
||||||
channelsToSubscribe = new Set<string>();
|
readonly channelsToSubscribe = new Set<string>();
|
||||||
|
|
||||||
// handlers
|
// handlers
|
||||||
handleMessage = (data: Message): void => {
|
handleMessage = (data: Message): void => {
|
||||||
|
|||||||
@@ -14,15 +14,15 @@ import StorageModel from "./storageModel";
|
|||||||
import { checkMatchesObjectStructure } from "../Utility/typeSafety";
|
import { checkMatchesObjectStructure } from "../Utility/typeSafety";
|
||||||
|
|
||||||
export default class FileTransferModel {
|
export default class FileTransferModel {
|
||||||
storageModel: StorageModel;
|
readonly storageModel: StorageModel;
|
||||||
connectionModel: ConnectionModel;
|
readonly connectionModel: ConnectionModel;
|
||||||
|
|
||||||
static READY_MESSAGE = "ready";
|
static READY_MESSAGE = "ready";
|
||||||
|
|
||||||
// data
|
// data
|
||||||
transferData: TransferData | undefined = undefined;
|
transferData: TransferData | undefined;
|
||||||
fileHandlerManager = new HandlerManager<string>();
|
readonly fileHandlerManager = new HandlerManager<string>();
|
||||||
readyToSendHandlerManager = new HandlerManager<boolean>();
|
readonly readyToSendHandlerManager = new HandlerManager<boolean>();
|
||||||
direction: TransferDirections = TransferDirections.Send;
|
direction: TransferDirections = TransferDirections.Send;
|
||||||
|
|
||||||
// general
|
// general
|
||||||
@@ -140,8 +140,8 @@ export default class FileTransferModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface TransferData {
|
export interface TransferData {
|
||||||
channel: string;
|
readonly channel: string;
|
||||||
key: string;
|
readonly key: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FileData {
|
export interface FileData {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import StorageModel, { StorageModelSubPaths, filePaths } from "./storageModel";
|
import StorageModel, { StorageModelSubPaths, filePaths } from "./storageModel";
|
||||||
|
|
||||||
export default class SettingsModel {
|
export default class SettingsModel {
|
||||||
storageModel: StorageModel;
|
readonly storageModel: StorageModel;
|
||||||
|
|
||||||
// data
|
// data
|
||||||
username: string;
|
username: string;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export default class ChatListViewModel {
|
|||||||
notificationViewModel: NotificationViewModel;
|
notificationViewModel: NotificationViewModel;
|
||||||
|
|
||||||
// data
|
// data
|
||||||
chatIndexManager = new IndexManager<ChatViewModel>(
|
readonly chatIndexManager = new IndexManager<ChatViewModel>(
|
||||||
(chatViewModel: ChatViewModel) =>
|
(chatViewModel: ChatViewModel) =>
|
||||||
chatViewModel.settingsPageViewModel.primaryChannel.value,
|
chatViewModel.settingsPageViewModel.primaryChannel.value,
|
||||||
);
|
);
|
||||||
@@ -96,9 +96,9 @@ export default class ChatListViewModel {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public settingsViewModel: SettingsViewModel,
|
public readonly settingsViewModel: SettingsViewModel,
|
||||||
public connectionViewModel: ConnectionViewModel,
|
public readonly connectionViewModel: ConnectionViewModel,
|
||||||
) {
|
) {
|
||||||
this.notificationViewModel = new NotificationViewModel(this);
|
this.notificationViewModel = new NotificationViewModel(this);
|
||||||
|
|
||||||
|
|||||||
@@ -123,8 +123,8 @@ export default class ChatMessageViewModel {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public messagePageViewModel: MessagePageViewModel,
|
public readonly messagePageViewModel: MessagePageViewModel,
|
||||||
chatMessage: ChatMessage,
|
chatMessage: ChatMessage,
|
||||||
sentByUser: boolean,
|
sentByUser: boolean,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -145,12 +145,12 @@ export default class ChatViewModel extends ContextHost<ChatPageTypes> {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public chatModel: ChatModel,
|
public readonly chatModel: ChatModel,
|
||||||
public settingsViewModel: SettingsViewModel,
|
public readonly settingsViewModel: SettingsViewModel,
|
||||||
public notificationViewModel: NotificationViewModel,
|
public readonly notificationViewModel: NotificationViewModel,
|
||||||
public connectionViewModel: ConnectionViewModel,
|
public readonly connectionViewModel: ConnectionViewModel,
|
||||||
public chatListViewModel: ChatListViewModel,
|
public readonly chatListViewModel: ChatListViewModel,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export default class ConnectionViewModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(public coreViewModel: CoreViewModel) {
|
constructor(public readonly coreViewModel: CoreViewModel) {
|
||||||
this.updatePreviousAddresses();
|
this.updatePreviousAddresses();
|
||||||
|
|
||||||
coreViewModel.connectionModel.connectionChangeHandlerManager.addHandler(
|
coreViewModel.connectionModel.connectionChangeHandlerManager.addHandler(
|
||||||
|
|||||||
@@ -66,11 +66,11 @@ export default class CoreViewModel {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public storageModel: StorageModel,
|
public readonly storageModel: StorageModel,
|
||||||
public settingsModel: SettingsModel,
|
public readonly settingsModel: SettingsModel,
|
||||||
public connectionModel: ConnectionModel,
|
public readonly connectionModel: ConnectionModel,
|
||||||
public chatListModel: ChatListModel,
|
public readonly chatListModel: ChatListModel,
|
||||||
public fileTransferModel: FileTransferModel,
|
public readonly fileTransferModel: FileTransferModel,
|
||||||
) {
|
) {
|
||||||
this.translations =
|
this.translations =
|
||||||
allTranslations[settingsModel.language] || allTranslations.en;
|
allTranslations[settingsModel.language] || allTranslations.en;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import CoreViewModel, { Context } from "./coreViewModel";
|
|||||||
import { CommonKeys } from "../../View/keystrokes";
|
import { CommonKeys } from "../../View/keystrokes";
|
||||||
|
|
||||||
export default class FileTransferViewModel extends Context {
|
export default class FileTransferViewModel extends Context {
|
||||||
contextDebugDescription: string = "transfer";
|
contextDebugDescription = "transfer";
|
||||||
|
|
||||||
// state
|
// state
|
||||||
presentedModal: React.State<FileTransferModals | undefined> =
|
presentedModal: React.State<FileTransferModals | undefined> =
|
||||||
@@ -172,7 +172,7 @@ export default class FileTransferViewModel extends Context {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(public coreViewModel: CoreViewModel) {
|
constructor(public readonly coreViewModel: CoreViewModel) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.coreViewModel.fileTransferModel.fileHandlerManager.addHandler(
|
this.coreViewModel.fileTransferModel.fileHandlerManager.addHandler(
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export default class NotificationViewModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(public chatListViewModel: ChatListViewModel) {}
|
constructor(public readonly chatListViewModel: ChatListViewModel) {}
|
||||||
|
|
||||||
// util
|
// util
|
||||||
static createNotification(message: ChatMessage): Notification {
|
static createNotification(message: ChatMessage): Notification {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Languages, ThemeSettings } from "../../Model/Global/settingsModel";
|
|||||||
import { CommonKeys } from "../../View/keystrokes";
|
import { CommonKeys } from "../../View/keystrokes";
|
||||||
|
|
||||||
export default class SettingsViewModel extends Context {
|
export default class SettingsViewModel extends Context {
|
||||||
contextDebugDescription: string = "settings";
|
contextDebugDescription = "settings";
|
||||||
|
|
||||||
// state
|
// state
|
||||||
username: React.State<string> = new React.State("");
|
username: React.State<string> = new React.State("");
|
||||||
@@ -72,7 +72,7 @@ export default class SettingsViewModel extends Context {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(public coreViewModel: CoreViewModel) {
|
constructor(public readonly coreViewModel: CoreViewModel) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.username.value = coreViewModel.settingsModel.username;
|
this.username.value = coreViewModel.settingsModel.username;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export default class StorageViewModel extends Context {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(public coreViewModel: CoreViewModel) {
|
constructor(public readonly coreViewModel: CoreViewModel) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.selectedFileName = React.createProxyState(
|
this.selectedFileName = React.createProxyState(
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import TaskViewModel from "./taskViewModel";
|
|||||||
import { CommonKeys } from "../../View/keystrokes";
|
import { CommonKeys } from "../../View/keystrokes";
|
||||||
|
|
||||||
export default class BoardViewModel extends TaskContainingPageViewModel {
|
export default class BoardViewModel extends TaskContainingPageViewModel {
|
||||||
contextDebugDescription: string = "board";
|
contextDebugDescription = "board";
|
||||||
|
|
||||||
// state
|
// state
|
||||||
name: React.State<string> = new React.State("");
|
name: React.State<string> = new React.State("");
|
||||||
@@ -247,11 +247,11 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public chatViewModel: ChatViewModel,
|
public readonly chatViewModel: ChatViewModel,
|
||||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
public readonly boardsAndTasksModel: BoardsAndTasksModel,
|
||||||
public taskPageViewModel: TaskPageViewModel,
|
public readonly taskPageViewModel: TaskPageViewModel,
|
||||||
public boardInfo: BoardInfoFileContent,
|
public readonly boardInfo: BoardInfoFileContent,
|
||||||
) {
|
) {
|
||||||
super(coreViewModel, chatViewModel, boardsAndTasksModel);
|
super(coreViewModel, chatViewModel, boardsAndTasksModel);
|
||||||
|
|
||||||
|
|||||||
@@ -185,10 +185,10 @@ export default class CalendarPageViewModel extends TaskContainingPageViewModel {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public chatViewModel: ChatViewModel,
|
public readonly chatViewModel: ChatViewModel,
|
||||||
public calendarModel: CalendarModel,
|
public readonly calendarModel: CalendarModel,
|
||||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
public readonly boardsAndTasksModel: BoardsAndTasksModel,
|
||||||
) {
|
) {
|
||||||
super(coreViewModel, chatViewModel, boardsAndTasksModel);
|
super(coreViewModel, chatViewModel, boardsAndTasksModel);
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ export default class HomeViewModel extends Context {
|
|||||||
contextDebugDescription = "home";
|
contextDebugDescription = "home";
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public settingsViewModel: SettingsViewModel,
|
public readonly settingsViewModel: SettingsViewModel,
|
||||||
public fileTransferViewModel: FileTransferViewModel,
|
public readonly fileTransferViewModel: FileTransferViewModel,
|
||||||
public storageViewModel: StorageViewModel,
|
public readonly storageViewModel: StorageViewModel,
|
||||||
public connectionViewModel: ConnectionViewModel,
|
public readonly connectionViewModel: ConnectionViewModel,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
|||||||
@@ -127,8 +127,8 @@ export default class MessagePageViewModel extends Context {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public chatViewModel: ChatViewModel,
|
public readonly chatViewModel: ChatViewModel,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ export default class SettingsPageViewModel extends Context {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public chatViewModel: ChatViewModel,
|
public readonly chatViewModel: ChatViewModel,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import TaskViewModel from "./taskViewModel";
|
|||||||
|
|
||||||
export default class TaskContainingPageViewModel extends Context {
|
export default class TaskContainingPageViewModel extends Context {
|
||||||
// state
|
// state
|
||||||
taskIndexManager = new IndexManager<TaskViewModel>(
|
readonly taskIndexManager = new IndexManager<TaskViewModel>(
|
||||||
(taskViewModel: TaskViewModel) => taskViewModel.sortingString,
|
(taskViewModel: TaskViewModel) => taskViewModel.sortingString,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -56,9 +56,9 @@ export default class TaskContainingPageViewModel extends Context {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public chatViewModel: ChatViewModel,
|
public readonly chatViewModel: ChatViewModel,
|
||||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
public readonly boardsAndTasksModel: BoardsAndTasksModel,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import { IndexManager } from "../../Model/Utility/utility";
|
|||||||
import { CommonKeys } from "../../View/keystrokes";
|
import { CommonKeys } from "../../View/keystrokes";
|
||||||
|
|
||||||
export default class TaskPageViewModel extends ContextHost<string> {
|
export default class TaskPageViewModel extends ContextHost<string> {
|
||||||
contextDebugDescription: string = "task-page";
|
contextDebugDescription = "task-page";
|
||||||
|
|
||||||
// data
|
// data
|
||||||
boardIndexManager = new IndexManager<BoardViewModel>(
|
readonly boardIndexManager = new IndexManager<BoardViewModel>(
|
||||||
(boardViewModel: BoardViewModel) => boardViewModel.name.value,
|
(boardViewModel: BoardViewModel) => boardViewModel.name.value,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -162,9 +162,9 @@ export default class TaskPageViewModel extends ContextHost<string> {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public chatViewModel: ChatViewModel,
|
public readonly chatViewModel: ChatViewModel,
|
||||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
public readonly boardsAndTasksModel: BoardsAndTasksModel,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
|||||||
@@ -210,10 +210,10 @@ export default class TaskViewModel extends Context {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
public coreViewModel: CoreViewModel,
|
public readonly coreViewModel: CoreViewModel,
|
||||||
public chatViewModel: ChatViewModel,
|
public readonly chatViewModel: ChatViewModel,
|
||||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
public readonly boardsAndTasksModel: BoardsAndTasksModel,
|
||||||
public containingModel: TaskContainingPageViewModel,
|
public readonly containingModel: TaskContainingPageViewModel,
|
||||||
public task: TaskFileContent,
|
public task: TaskFileContent,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default class TaskPropertyBulkChangeViewModel {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
setValue: (newValue: string, taskViewModel: TaskViewModel) => void = () => {};
|
setValue: (newValue: string, taskViewModel: TaskViewModel) => void;
|
||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
Reference in New Issue
Block a user