start home page and settings

This commit is contained in:
marlon-erler
2024-07-19 23:45:07 +02:00
parent 5da13eace5
commit eaaf4b813c
13 changed files with 349 additions and 301 deletions
+5
View File
@@ -0,0 +1,5 @@
export const DATA_VERSION = "v2"
export function checkIsValidObject(object: any): boolean {
return object.dataVersion == DATA_VERSION;
}
+13
View File
@@ -0,0 +1,13 @@
// date
export function createTimestamp(): string {
return new Date().toISOString();
}
// string
export function stringify(data: any): string {
return JSON.stringify(data);
}
export function parse(string: string): any {
return JSON.parse(string);
}
+2 -2
View File
@@ -2,8 +2,8 @@
import StorageModel, { storageKeys } from "./storageModel";
import { checkIsValidObject } from "../typeSafety";
import { createTimestamp } from "../utility";
import { checkIsValidObject } from "./Utility/typeSafety";
import { createTimestamp } from "./Utility/utility";
import { v4 } from "uuid";
export class ChatModel {
+1 -1
View File
@@ -3,7 +3,7 @@
import UDNFrontend, { Message } from "udn-frontend";
import { ChatMessage } from "./chatModel";
import { stringify } from "../utility";
import { stringify } from "./Utility/utility";
export default class ConnectionModel {
// basic
+2 -2
View File
@@ -1,8 +1,8 @@
// this file is responsible for reading and writing persistent data; all storage shall be handled by this file.
import { parse, stringify } from "../utility";
import { parse, stringify } from "./Utility/utility";
import { DATA_VERSION } from "../typeSafety";
import { DATA_VERSION } from "./Utility/typeSafety";
export default class StorageModel {
storageEntryTree: StorageEntry = {};