Skip to content

Commit abb5a94

Browse files
committed
fix: fix bug where pages created before the Loro integration can't be edited.
1 parent a476b3e commit abb5a94

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/routes/(app)/[username]/[slug]/+page.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636
3737
async function startEdit() {
3838
if (data.profileMatchesUserSession || data.page.wiki) {
39-
const resp = await fetch(`/${$page.params.username}/${$page.params.slug}/loroSnapshot`);
40-
await checkResponse(resp);
41-
previousLoroSnapshot = new Uint8Array(await resp.arrayBuffer());
39+
try {
40+
const resp = await fetch(`/${$page.params.username}/${$page.params.slug}/loroSnapshot`);
41+
await checkResponse(resp);
42+
previousLoroSnapshot = new Uint8Array(await resp.arrayBuffer());
43+
} catch (_) {}
4244
editingState.page = data.page;
4345
editingState.editing = true;
4446
}

0 commit comments

Comments
 (0)