Skip to content

Commit

Permalink
fix: delete shared query param after consumption
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Jun 30, 2024
1 parent fa7f986 commit fccba7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions apps/web/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import DragAdd from "./DragAdd.svelte"
import Scripts from "./Scripts.svelte"
import Shortcuts from "./GlobalShortcuts.svelte"
import type { LayoutData } from "./$types"
import { browser } from "$app/environment"
import { goto } from "$app/navigation";
import { page } from "$app/stores";
import type { LayoutData } from "./$types"
import { onNavigate } from "$app/navigation"
import { defaultAISettings, useInterface } from "$state/ui.svelte"
Expand All @@ -22,10 +24,10 @@
const { data, children }: { data: LayoutData; children: Snippet } = $props()
// Share Target Redirect
const urlParams = new URLSearchParams(window.location.search);
const sharedSuccess = urlParams.get('shared')
const sharedSuccess = $page.url.searchParams.get('shared')
if (sharedSuccess === "true") {
toast.success('Link saved!')
goto('/')
}
// Set current user preferences to store
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/service-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ self.addEventListener("fetch", (event: FetchEvent) => {
console.log("SW.targetUrl", targetUrl)

// TODO: Get userId
const userId = "clu6qepua0000scqbkr2t0uks"
const userId = "clu6qepua0000scqbkr2t0ukz"

await fetch("/api/v1/bookmarks", {
method: "POST",
Expand Down

0 comments on commit fccba7d

Please sign in to comment.