Fix some nux types
parent
9bb385a4dd
commit
c8b133863d
|
@ -40,13 +40,16 @@ function Inner() {
|
||||||
}, [setSnoozed])
|
}, [setSnoozed])
|
||||||
|
|
||||||
const dismissActiveNux = React.useCallback(() => {
|
const dismissActiveNux = React.useCallback(() => {
|
||||||
|
if (!activeNux) return
|
||||||
setActiveNux(undefined)
|
setActiveNux(undefined)
|
||||||
|
const nux = nuxs?.find(nux => nux.id === activeNux)
|
||||||
upsertNux({
|
upsertNux({
|
||||||
id: activeNux!,
|
id: activeNux,
|
||||||
completed: true,
|
completed: true,
|
||||||
data: undefined,
|
data: nux?.data,
|
||||||
|
expiresAt: nux?.expiresAt,
|
||||||
})
|
})
|
||||||
}, [activeNux, setActiveNux, upsertNux])
|
}, [activeNux, setActiveNux, upsertNux, nuxs])
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (snoozed) return
|
if (snoozed) return
|
||||||
|
|
|
@ -4,6 +4,4 @@ export type Data = Record<string, unknown> | undefined
|
||||||
|
|
||||||
export type BaseNux<
|
export type BaseNux<
|
||||||
T extends Pick<AppBskyActorDefs.Nux, 'id' | 'expiresAt'> & {data: Data},
|
T extends Pick<AppBskyActorDefs.Nux, 'id' | 'expiresAt'> & {data: Data},
|
||||||
> = T & {
|
> = Pick<AppBskyActorDefs.Nux, 'id' | 'completed' | 'expiresAt'> & T
|
||||||
completed: boolean
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue