integrate FileModel with ChatModel

This commit is contained in:
marlon-erler
2024-07-21 21:45:18 +02:00
parent b37f1caa66
commit da757d10d1
3 changed files with 67 additions and 80 deletions
+6 -1
View File
@@ -7,6 +7,7 @@ import { decryptString, encryptString } from "./Utility/crypto";
import ChatListModel from "./chatListModel";
import { Color } from "../ViewModel/colors";
import ConnectionModel from "./connectionModel";
import FileModel from "./fileModel";
import SettingsModel from "./settingsModel";
import { checkIsValidObject } from "./Utility/typeSafety";
import { v4 } from "uuid";
@@ -17,6 +18,8 @@ export default class ChatModel {
settingsModel: SettingsModel;
chatListModel: ChatListModel;
fileModel: FileModel;
// data
id: string;
info: ChatInfo;
@@ -210,6 +213,8 @@ export default class ChatModel {
this.subscribe();
connectionModel.setMessageSentHandler(this.handleMessageSent);
this.fileModel = new FileModel(this);
}
// utility
@@ -280,4 +285,4 @@ export interface ChatMessage {
status?: ChatMessageStatus;
stringifiedFile?: string;
}
}