fix settings initialization

This commit is contained in:
Iris Lightshard 2024-07-16 14:11:46 -06:00
parent 2976d438d9
commit 0106b445b5
Signed by: Iris Lightshard
GPG key ID: 688407174966CAF3

View file

@ -9,7 +9,8 @@ import { AdapterElement } from "./adapter-element"
import { ThreadSummaryElement } from "./thread-summary-element" import { ThreadSummaryElement } from "./thread-summary-element"
function main() { function main() {
Settings._instance = <Settings>JSON.parse(localStorage.getItem("settings") ?? "{}"); const saveData = localStorage.getItem("settings");
Settings._instance = saveData ? <Settings>JSON.parse(saveData) : new Settings();
customElements.define("underbbs-tabbar", TabBarElement); customElements.define("underbbs-tabbar", TabBarElement);
customElements.define("underbbs-message", MessageElement); customElements.define("underbbs-message", MessageElement);