From 3ab6c435df5dc3d17fe3e2531231ccf012a4860c Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 6 Dec 2024 09:42:42 -0600 Subject: Trim back prefs exposure in NUXs, make naming more friendly (#6980) --- src/components/dialogs/nuxs/index.tsx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/components/dialogs/nuxs/index.tsx') diff --git a/src/components/dialogs/nuxs/index.tsx b/src/components/dialogs/nuxs/index.tsx index 701ae84e6..11d622a4d 100644 --- a/src/components/dialogs/nuxs/index.tsx +++ b/src/components/dialogs/nuxs/index.tsx @@ -3,12 +3,7 @@ import {AppBskyActorDefs} from '@atproto/api' import {useGate} from '#/lib/statsig/statsig' import {logger} from '#/logger' -import { - Nux, - useNuxs, - useRemoveNuxsMutation, - useUpsertNuxMutation, -} from '#/state/queries/nuxs' +import {Nux, useNuxs, useResetNuxs, useSaveNux} from '#/state/queries/nuxs' import { usePreferencesQuery, UsePreferencesQueryResponse, @@ -85,8 +80,8 @@ function Inner({ return isSnoozed() }) const [activeNux, setActiveNux] = React.useState() - const {mutateAsync: upsertNux} = useUpsertNuxMutation() - const {mutate: removeNuxs} = useRemoveNuxsMutation() + const {mutateAsync: saveNux} = useSaveNux() + const {mutate: resetNuxs} = useResetNuxs() const snoozeNuxDialog = React.useCallback(() => { snooze() @@ -102,7 +97,7 @@ function Inner({ // @ts-ignore window.clearNuxDialog = (id: Nux) => { if (!IS_DEV || !id) return - removeNuxs([id]) + resetNuxs([id]) unsnooze() } } @@ -136,7 +131,7 @@ function Inner({ snoozeNuxDialog() // immediately update remote data (affects next reload) - upsertNux({ + saveNux({ id, completed: true, data: undefined, @@ -152,7 +147,7 @@ function Inner({ nuxs, snoozed, snoozeNuxDialog, - upsertNux, + saveNux, gate, currentAccount, currentProfile, -- cgit 1.4.1