about summary refs log tree commit diff
path: root/src/components/dialogs/nuxs/index.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-09-11 21:28:34 -0500
committerEric Bailey <git@esb.lol>2024-09-11 21:28:34 -0500
commitc8b133863df5c6b417562f71f8a3c6feef280139 (patch)
tree436c4536ab957e6856a0aba79580f8b262e945d8 /src/components/dialogs/nuxs/index.tsx
parent9bb385a4dd54aca2b21533b7dd919ac8d0b4aeef (diff)
downloadvoidsky-c8b133863df5c6b417562f71f8a3c6feef280139.tar.zst
Fix some nux types
Diffstat (limited to 'src/components/dialogs/nuxs/index.tsx')
-rw-r--r--src/components/dialogs/nuxs/index.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/dialogs/nuxs/index.tsx b/src/components/dialogs/nuxs/index.tsx
index 6c4598cdb..36db7764d 100644
--- a/src/components/dialogs/nuxs/index.tsx
+++ b/src/components/dialogs/nuxs/index.tsx
@@ -40,13 +40,16 @@ function Inner() {
   }, [setSnoozed])
 
   const dismissActiveNux = React.useCallback(() => {
+    if (!activeNux) return
     setActiveNux(undefined)
+    const nux = nuxs?.find(nux => nux.id === activeNux)
     upsertNux({
-      id: activeNux!,
+      id: activeNux,
       completed: true,
-      data: undefined,
+      data: nux?.data,
+      expiresAt: nux?.expiresAt,
     })
-  }, [activeNux, setActiveNux, upsertNux])
+  }, [activeNux, setActiveNux, upsertNux, nuxs])
 
   React.useEffect(() => {
     if (snoozed) return