beta12 for porting old format
This commit is contained in:
@@ -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 => {
|
||||
|
||||
@@ -67,6 +67,8 @@ export default class FileModel {
|
||||
};
|
||||
|
||||
readonly handleFileContent = (fileContent: FileContent<string>): void => {
|
||||
console.log(fileContent.type);
|
||||
|
||||
if (fileContent.type == "chat-info") {
|
||||
if (checkMatchesObjectStructure(fileContent, ChatInfoReference) == false) return;
|
||||
this.chatModel.handleInfo(fileContent as ChatInfoFileContent);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -224,7 +224,7 @@ export function parseValidObject<T>(string: string, reference: T): T | null {
|
||||
parsed,
|
||||
reference,
|
||||
);
|
||||
if (doesMatchReference == false) return null;
|
||||
if (doesMatchReference == false) return null;
|
||||
|
||||
return parsed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user