Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Aug 11, 2024
1 parent e7b4d9a commit e147c5c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
1 change: 0 additions & 1 deletion apps/web/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export const { signIn, signOut, handle } = SvelteKitAuth({
},
callbacks: {
async jwt({ token, profile, account, user, trigger }) {
console.log("args", { token, profile, account, user, trigger })
if (account) {
// Initial user profile
const userProfile: User = {
Expand Down
14 changes: 7 additions & 7 deletions apps/web/src/lib/components/navbar/AvatarMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
onMount(() => {
window.addEventListener("beforeinstallprompt", (event) => {
console.log("beforeinstallprompt", { offerInstall })
event.preventDefault()
installPrompt = event
offerInstall = true
console.log("beforeinstallprompt", { offerInstall })
})
window.addEventListener("appinstalled", () => {
console.log("appinstalled", { offerInstall })
installPrompt = null
offerInstall = false
console.log("appinstalled", { offerInstall })
})
})
Expand All @@ -41,7 +41,7 @@
// @ts-expect-error TODO: find exact type for beforeinstallprompt Event
const result = await installPrompt.prompt()
console.log("Install prompt", result.outcome)
console.log("prompt.result", result.outcome)
installPrompt = null
offerInstall = false
Expand All @@ -50,7 +50,7 @@

<DropdownMenu.Root>
<DropdownMenu.Trigger
class="rounded-full transition duration-300 outline-none focus:ring-2 focus:outline-none dark:focus:ring-zinc-500 focus:ring-zinc-200"
class="rounded-full outline-none transition duration-300 focus:outline-none focus:ring-2 focus:ring-zinc-200 dark:focus:ring-zinc-500"
>
<Avatar.Root>
<Avatar.Image
Expand All @@ -59,7 +59,7 @@
class="rounded"
alt="User Avatar"
/>
<Avatar.Fallback><Skeleton class="w-full h-full rounded-full" /></Avatar.Fallback>
<Avatar.Fallback><Skeleton class="h-full w-full rounded-full" /></Avatar.Fallback>
</Avatar.Root>
</DropdownMenu.Trigger>
<DropdownMenu.Content
Expand All @@ -68,15 +68,15 @@
sideOffset={8}
>
<DropdownMenu.Group>
<DropdownMenu.Label class="justify-start w-full max-w-32">
<DropdownMenu.Label class="max-w-32 w-full justify-start">
<div class="truncate">
{$page.data.session?.user?.name ?? $page.data.session?.user?.email}
</div>
<div class="font-light text-neutral-400 dark:text-neutral-600">{version}</div>
</DropdownMenu.Label>
<DropdownMenu.Separator class="bg-neutral-100 dark:bg-neutral-800" />
<DropdownMenu.CheckboxItem
class="justify-start hover:cursor-pointer before:content-[''] before:absolute before:left-1 before:bg-neutral-200 before:size-[1.35rem] before:rounded-sm data-[state=checked]:before:bg-neutral-800 [&_svg]:size-4"
class="before:size-[1.35rem] [&_svg]:size-4 justify-start before:absolute before:left-1 before:rounded-sm before:bg-neutral-200 before:content-[''] hover:cursor-pointer data-[state=checked]:before:bg-neutral-800"
onCheckedChange={toggleMode}
checked={isDarkMode}
>
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/routes/(dashboard)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
$effect(() => {
bookmarkService.bookmarks = $page.data.bookmarks.data
})
$inspect("inspect.BOOKMARKS", bookmarkService.bookmarks)
</script>

<svelte:head>
Expand Down
9 changes: 2 additions & 7 deletions apps/web/src/routes/(dashboard)/bookmarks/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,26 +148,21 @@ export const actions: Actions = {

// Add bookmark to queue for fetching screenshot
if (PUBLIC_WORKER_URL) {
const res = await event.fetch(`${PUBLIC_WORKER_URL}/v1/bookmark`, {
await event.fetch(`${PUBLIC_WORKER_URL}/v1/bookmark`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ data: [{ url }] }),
})
console.log("bookmarks.workerRes", res)
}

return message(form, {
bookmark,
text: "Bookmark Added!",
})
} catch (error) {
if (error instanceof Error) {
console.error(error.message)
} else {
console.error(error)
}
console.error(String(error))
fail(500, { type: "error", message: "Failed to add bookmark" })
}
},
Expand Down

0 comments on commit e147c5c

Please sign in to comment.