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 // data
readonly id: string; readonly id: string;
info: ChatInfo; /* load function called in constructor */ info: ChatInfoFileContent; /* load function called in constructor */
color: Colors = Colors.Standard; color: Colors = Colors.Standard;
get secondaryChannels(): string[] { get secondaryChannels(): string[] {
@@ -278,7 +278,7 @@ export default class ChatModel {
// load // load
readonly loadInfo = (): void => { readonly loadInfo = (): void => {
const info: ChatInfo | null = this.storageModel.readStringifiable( const info: ChatInfoFileContent | null = this.storageModel.readStringifiable(
this.getInfoPath(), this.getInfoPath(),
ChatInfoReference, ChatInfoReference,
); );
@@ -374,9 +374,11 @@ export default class ChatModel {
return channelString.split("/"); 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 { return {
dataVersion: DATA_VERSION, ...file,
name, name,
secondaryChannels: [], secondaryChannels: [],
@@ -464,7 +466,7 @@ export enum ReactionSymbols {
Question = "❓", Question = "❓",
} }
export interface ChatInfo extends ValidObject { export interface ChatInfoFileContent extends FileContent<"chat-info"> {
name: string; name: string;
secondaryChannels: string[]; secondaryChannels: string[];
encryptionKey: string; encryptionKey: string;
@@ -502,8 +504,14 @@ extends ValidObject, FileContent<"reaction"> {
} }
// references // references
export const ChatInfoReference: ChatInfo = { export const ChatInfoReference: ChatInfoFileContent = {
dataVersion: DATA_VERSION, dataVersion: DATA_VERSION,
fileId: "",
fileContentId: "",
creationDate: "",
type: "chat-info",
name: "", name: "",
secondaryChannels: [""], secondaryChannels: [""],
+1 -1
View File
@@ -324,7 +324,7 @@ export interface TaskFileContent extends FileContent<"task"> {
export const BoardInfoFileContentReference: BoardInfoFileContent = { export const BoardInfoFileContentReference: BoardInfoFileContent = {
dataVersion: DATA_VERSION, dataVersion: DATA_VERSION,
fileId: "string", fileId: "",
fileContentId: "", fileContentId: "",
creationDate: "", creationDate: "",