convert ChatInfo to satisfy FileContent ifc

This commit is contained in:
marlon-erler
2026-09-26 14:27:38 +02:00
parent ec3d8988f8
commit 084a402f43
2 changed files with 15 additions and 7 deletions
+14 -6
View File
@@ -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: [""],
+1 -1
View File
@@ -324,7 +324,7 @@ export interface TaskFileContent extends FileContent<"task"> {
export const BoardInfoFileContentReference: BoardInfoFileContent = {
dataVersion: DATA_VERSION,
fileId: "string",
fileId: "",
fileContentId: "",
creationDate: "",