import adapter from "./adapter"; let adapters = []; function $(id) { return document.getElementById(id); } function main() { let settings = JSON.parse(localStorage.getItem("settings"));; if (settings != null) { for (let s of settings.adapters) { switch (s.protocol) { case "nostr": let a = adapter.toNostrAdapter(adapter.createAdapter(), s); adapters.push(a); break; } } } else { console.log("no settings exist for this client"); } }; function showSettings() { // tab bar hidden let tabbar = $("tabbar"); tabbar.style.display = "none"; // tabcontent to show settings ui let tabcontent = $("tabcontent"); tabcontent.innerHTML = "

this is our settings dialogue

"; tabcontent.innerHTML += ""; } function saveSettings() { if (window.settings) { localStorage.setItem("settings", JSON.stringify(window.settings)); } // tab bar hidden let tabbar = $("tabbar"); tabbar.style.display = "block"; // tabcontent to show settings ui let tabcontent = $("tabcontent"); tabcontent.innerHTML = ""; } window.showSettings = showSettings; window.saveSettings = saveSettings; main();