Skip to content

Commit

Permalink
fix: share success toast
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Jun 30, 2024
1 parent fccba7d commit 31a5957
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ tsconfig.tsbuildinfo
**/playwright-report/
**/blob-report/
**/playwright/.cache/

haters/
dev-dist
13 changes: 13 additions & 0 deletions apps/web/src/routes/(dashboard)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
import { Navbar } from "$lib/components/navbar"
import { HomeScroller } from "$lib/components/home-scroller"
import { ScrollerTypes } from "$lib/types"
import { toast } from "svelte-sonner"
import { goto } from "$app/navigation"
import { page } from "$app/stores"
import { onMount } from "svelte"
onMount(() => {
// Share Target Redirect
const sharedSuccess = $page.url.searchParams.get("shared")
if (sharedSuccess === "true") {
toast.success("Link saved!")
goto("/")
}
})
type HomeLoadResults = {
bookmarks: {
Expand Down
11 changes: 1 addition & 10 deletions apps/web/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<script lang="ts">
import { type Snippet } from "svelte"
import { setContext } from "svelte"
import { Toaster, toast } from "svelte-sonner"
import { Toaster } from "svelte-sonner"
import DragAdd from "./DragAdd.svelte"
import Scripts from "./Scripts.svelte"
import Shortcuts from "./GlobalShortcuts.svelte"
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"
Expand All @@ -23,13 +21,6 @@
const { data, children }: { data: LayoutData; children: Snippet } = $props()
// Share Target Redirect
const sharedSuccess = $page.url.searchParams.get('shared')
if (sharedSuccess === "true") {
toast.success('Link saved!')
goto('/')
}
// Set current user preferences to store
ui.aiFeaturesPreferences = data.session?.user?.settings?.ai ?? defaultAISettings
Expand Down

0 comments on commit 31a5957

Please sign in to comment.