From 084a402f43d4060af75f250fd25102eb9bea3f24 Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Sat, 26 Sep 2026 14:27:38 +0200 Subject: [PATCH] convert ChatInfo to satisfy FileContent ifc --- src/Model/Chat/chatModel.ts | 20 ++++++++++++++------ src/Model/Files/boardsAndTasksModel.ts | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Model/Chat/chatModel.ts b/src/Model/Chat/chatModel.ts index 775b018a..50a28912 100644 --- a/src/Model/Chat/chatModel.ts +++ b/src/Model/Chat/chatModel.ts @@ -34,7 +34,7 @@ export default class ChatModel { // data readonly id: string; - info: ChatInfo; /* load function called in constructor */ + info: ChatInfoFileContent; /* load function called in constructor */ color: Colors = Colors.Standard; get secondaryChannels(): string[] { @@ -278,7 +278,7 @@ export default class ChatModel { // load readonly loadInfo = (): void => { - const info: ChatInfo | null = this.storageModel.readStringifiable( + const info: ChatInfoFileContent | null = this.storageModel.readStringifiable( this.getInfoPath(), ChatInfoReference, ); @@ -374,9 +374,11 @@ export default class ChatModel { return channelString.split("/"); } - static generateChatInfo = (name: string, id: string): ChatInfo => { + static generateChatInfo = (name: string, id: string): ChatInfoFileContent => { + const file = FileModel.createFileContent(id, "chat-info"); + return { - dataVersion: DATA_VERSION, + ...file, name, secondaryChannels: [], @@ -464,7 +466,7 @@ export enum ReactionSymbols { Question = "❓", } -export interface ChatInfo extends ValidObject { +export interface ChatInfoFileContent extends FileContent<"chat-info"> { name: string; secondaryChannels: string[]; encryptionKey: string; @@ -502,8 +504,14 @@ extends ValidObject, FileContent<"reaction"> { } // references -export const ChatInfoReference: ChatInfo = { +export const ChatInfoReference: ChatInfoFileContent = { dataVersion: DATA_VERSION, + + fileId: "", + fileContentId: "", + creationDate: "", + + type: "chat-info", name: "", secondaryChannels: [""], diff --git a/src/Model/Files/boardsAndTasksModel.ts b/src/Model/Files/boardsAndTasksModel.ts index 04198f6e..4b73f1aa 100644 --- a/src/Model/Files/boardsAndTasksModel.ts +++ b/src/Model/Files/boardsAndTasksModel.ts @@ -324,7 +324,7 @@ export interface TaskFileContent extends FileContent<"task"> { export const BoardInfoFileContentReference: BoardInfoFileContent = { dataVersion: DATA_VERSION, - fileId: "string", + fileId: "", fileContentId: "", creationDate: "",