Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions bitext/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,21 @@
});

// Keep the URL in sync so the diagram is shareable / reload-safe.
// The first run is the initially loaded (or default) state: leave the URL
// untouched so an idle `/` stays clean. Crawlers otherwise see the page
// replaceState to `?data=…` on load, which reads like a redirect.
let urlSyncPrimed = false;
let urlDebounce: ReturnType<typeof setTimeout> | undefined;
$effect(() => {
if (!browser || !hydrated) return;
void projectStore.lines;
void projectStore.connections;
void projectStore.pairControls;
void settingsStore.settings;
if (!urlSyncPrimed) {
urlSyncPrimed = true;
return;
}
clearTimeout(urlDebounce);
urlDebounce = setTimeout(() => {
const state: AppStateV2 = {
Expand Down
Loading