summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'packages/ui/src/hooks')
-rw-r--r--packages/ui/src/hooks/create-seen.ts20
-rw-r--r--packages/ui/src/hooks/index.ts1
2 files changed, 0 insertions, 21 deletions
diff --git a/packages/ui/src/hooks/create-seen.ts b/packages/ui/src/hooks/create-seen.ts
deleted file mode 100644
index c25726e75..000000000
--- a/packages/ui/src/hooks/create-seen.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { createSignal, onCleanup, onMount } from "solid-js"
-import { isServer } from "solid-js/web"
-
-export function createSeen(key: string, delay = 1000) {
- // 1. Initialize state based on storage (default to true on server to avoid flash)
- const storageKey = `app:seen:${key}`
- const [hasSeen] = createSignal(!isServer && sessionStorage.getItem(storageKey) === "true")
-
- onMount(() => {
- // 2. If we haven't seen it, mark it as seen for NEXT time
- if (!hasSeen()) {
- const timer = setTimeout(() => {
- sessionStorage.setItem(storageKey, "true")
- }, delay)
- onCleanup(() => clearTimeout(timer))
- }
- })
-
- return hasSeen
-}
diff --git a/packages/ui/src/hooks/index.ts b/packages/ui/src/hooks/index.ts
index 98b339cfa..7eef78091 100644
--- a/packages/ui/src/hooks/index.ts
+++ b/packages/ui/src/hooks/index.ts
@@ -1,2 +1 @@
export * from "./use-filtered-list"
-export * from "./create-seen"