import { appUrl } from "./base"; export let installed: boolean | null = null; export let hosted = false; export async function refreshInstalled() { const response = await fetch(appUrl("/api/install/status"), { cache: "no-store" }); const status = (await response.json()) as { installed?: boolean; hosted?: boolean }; installed = Boolean(status.installed); hosted = Boolean(status.hosted); return installed; } export function markInstalled() { installed = true; }