Attic is a cozy space with lofty ambitions. attic.social
11
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix dialog types

+6 -12
+6 -11
src/lib/dialog.svelte.ts
··· 1 1 export let pointer: { ref: HTMLElement | null } = $state({ ref: null }); 2 2 3 - export const openDialog = (dialog?: HTMLDialogElement) => { 4 - if (dialog === undefined) { 3 + export const openDialog = (dialog?: HTMLDialogElement | null) => { 4 + if ((dialog instanceof HTMLDialogElement) === false) { 5 5 return; 6 6 } 7 - 8 7 dialog.showModal(); 9 - 8 + // Move back to main document 10 9 dialog.addEventListener("close", () => { 11 10 if (pointer.ref) { 12 11 document.querySelector("attic-app")?.append(pointer.ref); 13 12 pointer.ref.showPopover(); 14 13 } 15 14 }, { once: true }); 16 - 15 + // Move to top-layer 17 16 if (pointer.ref) { 18 17 dialog.append(pointer.ref); 19 18 pointer.ref.showPopover(); 20 19 } 21 20 }; 22 21 23 - export const closeDialog = (dialog?: HTMLDialogElement) => { 24 - if (dialog === undefined) { 22 + export const closeDialog = (dialog?: HTMLDialogElement | null) => { 23 + if ((dialog instanceof HTMLDialogElement) === false) { 25 24 return; 26 25 } 27 26 dialog.close(); 28 - // if (pointer.ref) { 29 - // document.querySelector("attic-app")?.append(pointer.ref); 30 - // pointer.ref.showPopover(); 31 - // } 32 27 };
-1
src/routes/bookmarks/[did=did]/+page.ts
··· 10 10 11 11 export const load: PageLoad = async ({ params, data, fetch }) => { 12 12 const pds = await resolvePDS(params.did); 13 - 14 13 if (pds === null) { 15 14 error(404); 16 15 }