Fix: SplashScreen Default

This commit is contained in:
Youwes09
2026-03-27 15:37:02 -05:00
parent ac6b70fb32
commit 1f08b46919
8 changed files with 951 additions and 120 deletions
+5 -12
View File
@@ -1,21 +1,14 @@
import { store } from "../store/state.svelte";
const DEFAULT_URL = "http://127.0.0.1:4567";
function getSettings(): Record<string, any> {
try {
const raw = localStorage.getItem("moku-store");
if (raw) return JSON.parse(raw)?.settings ?? {};
} catch {}
return {};
}
function getServerUrl(): string {
const url = getSettings().serverUrl;
if (typeof url === "string" && url.trim()) return url.replace(/\/$/, "");
return DEFAULT_URL;
const url = store.settings.serverUrl;
return typeof url === "string" && url.trim() ? url.replace(/\/$/, "") : DEFAULT_URL;
}
function getAuthHeader(): Record<string, string> {
const s = getSettings();
const s = store.settings;
if (!s.serverAuthEnabled) return {};
const user = typeof s.serverAuthUser === "string" ? s.serverAuthUser.trim() : "";
const pass = typeof s.serverAuthPass === "string" ? s.serverAuthPass.trim() : "";