From 5a647da2de9f589d9e17a5fb08427c8d076136fd Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Sat, 26 Sep 2026 16:02:41 +0200 Subject: [PATCH] beta12 for porting old format --- dist/index.js | 4 +++- dist/sw.js | 2 +- dist/version.txt | 2 +- src/Model/Chat/chatModel.ts | 3 ++- src/Model/Files/fileModel.ts | 2 ++ src/Model/Global/fileTransferModel.ts | 2 +- src/Model/Utility/utility.ts | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 91c6b4a1..e0fa24da 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1751,11 +1751,12 @@ }; // load this.loadInfo = () => { - const info = this.storageModel.readStringifiable( + let info = this.storageModel.readStringifiable( this.getInfoPath(), ChatInfoReference ); this.info = info || _ChatModel.generateChatInfo("0", "0", "standard" /* Standard */); + this.storeInfo(); }; this.handleInfo = (info) => { this.info = info; @@ -1958,6 +1959,7 @@ this.handleFileContent(fileContent); }; this.handleFileContent = (fileContent) => { + console.log(fileContent.type); if (fileContent.type == "chat-info") { if (checkMatchesObjectStructure(fileContent, ChatInfoReference) == false) return; this.chatModel.handleInfo(fileContent); diff --git a/dist/sw.js b/dist/sw.js index 0b5b371c..c1937e83 100644 --- a/dist/sw.js +++ b/dist/sw.js @@ -1,4 +1,4 @@ -const VERSION = "2610 Beta 11" +const VERSION = "2610 Beta 12" function processUrl(event) { const url = event.request.url; diff --git a/dist/version.txt b/dist/version.txt index 9f37d77a..f3991da9 100644 --- a/dist/version.txt +++ b/dist/version.txt @@ -1 +1 @@ -2610 Beta 11 +2610 Beta 12 diff --git a/src/Model/Chat/chatModel.ts b/src/Model/Chat/chatModel.ts index bceda67c..e6e6c0a3 100644 --- a/src/Model/Chat/chatModel.ts +++ b/src/Model/Chat/chatModel.ts @@ -285,11 +285,12 @@ export default class ChatModel { // load readonly loadInfo = (): void => { - const info: ChatInfoFileContent | null = this.storageModel.readStringifiable( + let info: ChatInfoFileContent | null = this.storageModel.readStringifiable( this.getInfoPath(), ChatInfoReference, ); this.info = (info || ChatModel.generateChatInfo("0", "0", Colors.Standard)); + this.storeInfo(); }; readonly handleInfo = (info: ChatInfoFileContent): void => { diff --git a/src/Model/Files/fileModel.ts b/src/Model/Files/fileModel.ts index 05685df5..54be8183 100644 --- a/src/Model/Files/fileModel.ts +++ b/src/Model/Files/fileModel.ts @@ -67,6 +67,8 @@ export default class FileModel { }; readonly handleFileContent = (fileContent: FileContent): void => { + console.log(fileContent.type); + if (fileContent.type == "chat-info") { if (checkMatchesObjectStructure(fileContent, ChatInfoReference) == false) return; this.chatModel.handleInfo(fileContent as ChatInfoFileContent); diff --git a/src/Model/Global/fileTransferModel.ts b/src/Model/Global/fileTransferModel.ts index c9d98bda..a3990053 100644 --- a/src/Model/Global/fileTransferModel.ts +++ b/src/Model/Global/fileTransferModel.ts @@ -103,7 +103,7 @@ export default class FileTransferModel { }; readonly handleDecryptedFile = (data: string): void => { - const parsed: any = parse(data); + const parsed: any = parse(data); const isFileData: boolean = checkMatchesObjectStructure( parsed, FileDataReference, diff --git a/src/Model/Utility/utility.ts b/src/Model/Utility/utility.ts index 9bd2b72c..6d402470 100644 --- a/src/Model/Utility/utility.ts +++ b/src/Model/Utility/utility.ts @@ -224,7 +224,7 @@ export function parseValidObject(string: string, reference: T): T | null { parsed, reference, ); - if (doesMatchReference == false) return null; + if (doesMatchReference == false) return null; return parsed; }