diff --git a/crates/tauri-app/src/lib/components/LoginScreen.svelte b/crates/tauri-app/src/lib/components/LoginScreen.svelte index d9bb0b7..61db7b1 100644 --- a/crates/tauri-app/src/lib/components/LoginScreen.svelte +++ b/crates/tauri-app/src/lib/components/LoginScreen.svelte @@ -4,7 +4,10 @@ let { onLogin }: { onLogin: (s: Session) => void } = $props(); - let mode: "login" | "register" = $state("register"); + // Default to "login" — most users opening the app already have an + // account, and the empty-autocomplete form now matches the + // action-label pair they expect. "register" is one click away. + let mode: "login" | "register" = $state("login"); let handle: string = $state(""); let password: string = $state(""); let busy = $state(false); diff --git a/crates/tauri-app/src/lib/components/ProfileView.svelte b/crates/tauri-app/src/lib/components/ProfileView.svelte index 7f58c05..e0c8b7a 100644 --- a/crates/tauri-app/src/lib/components/ProfileView.svelte +++ b/crates/tauri-app/src/lib/components/ProfileView.svelte @@ -8,7 +8,7 @@ releaseBlob, getAppviewUrl, } from "../api/client"; - import { onDestroy, onMount } from "svelte"; + import { onDestroy, onMount, untrack } from "svelte"; type Props = { handle: string; @@ -99,31 +99,34 @@ const bannerCid = viewModel.kind === "ready" ? viewModel.data.banner_cid ?? null : null; // Release the previous URL whenever the banner CID changes - // (including to/from null). - if (bannerCidLoaded !== bannerCid) { - if (bannerUrl) { - if (viewModel.kind === "ready" && viewModel.data.did) { - releaseBlob(viewModel.data.did, bannerCidLoaded ?? ""); - } - URL.revokeObjectURL(bannerUrl); - bannerUrl = null; + // (including to/from null). We read the previous-loaded value + // through `untrack` because reading + writing `bannerCidLoaded` + // inside the same effect would trip Svelte 5's depth guard + // (`effect_update_depth_exceeded`). + const previous = untrack(() => bannerCidLoaded); + if (previous === bannerCid) return; + if (bannerUrl) { + if (viewModel.kind === "ready" && viewModel.data.did) { + releaseBlob(viewModel.data.did, previous ?? ""); } - bannerCidLoaded = bannerCid; - if (!bannerCid || viewModel.kind !== "ready") return; - const did = viewModel.data.did; - let cancelled = false; - fetchBlob(did, bannerCid) - .then((u) => { - if (!cancelled) bannerUrl = u; - else URL.revokeObjectURL(u); - }) - .catch(() => { - /* fall back to CSS gradient placeholder */ - }); - return () => { - cancelled = true; - }; + URL.revokeObjectURL(bannerUrl); + bannerUrl = null; } + bannerCidLoaded = bannerCid; + if (!bannerCid || viewModel.kind !== "ready") return; + const did = viewModel.data.did; + let cancelled = false; + fetchBlob(did, bannerCid) + .then((u) => { + if (!cancelled) bannerUrl = u; + else URL.revokeObjectURL(u); + }) + .catch(() => { + /* fall back to CSS gradient placeholder */ + }); + return () => { + cancelled = true; + }; }); onMount(() => {