remodel ChatViewModel

This commit is contained in:
marlon-erler
2024-07-22 21:07:44 +02:00
parent 7c4558a5b2
commit ba27c61a29
17 changed files with 541 additions and 361 deletions
+5
View File
@@ -5,6 +5,7 @@ import FileModel, { FileContent } from "../Files/fileModel";
import StorageModel, { filePaths } from "../Global/storageModel";
import {
createTimestamp,
localeCompare,
parseValidObject,
stringify,
} from "../Utility/utility";
@@ -31,6 +32,10 @@ export default class ChatModel {
chatMessageHandler: (chatMessage: ChatMessage) => void = () => {};
get secondaryChannels(): string[] {
return this.info.secondaryChannels.sort(localeCompare);
}
// paths
getBasePath = (): string[] => {
return StorageModel.getPath("chat", filePaths.chat.chatBase(this.id));