diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-07-04 12:08:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-04 20:08:33 +0100 |
commit | d837f96478dce8f6df03e387fa6d34086b01263f (patch) | |
tree | 5f1eaa8d23b4fa433fcbcb7a9d119092e2f5bac9 /src/state/shell/progress-guide.tsx | |
parent | 12bf79629370b59eaf3a8f052fef60bcf745fcf2 (diff) | |
download | voidsky-d837f96478dce8f6df03e387fa6d34086b01263f.tar.zst |
Fix responsiveness of dismissing the progress guide (#4729)
Diffstat (limited to 'src/state/shell/progress-guide.tsx')
-rw-r--r-- | src/state/shell/progress-guide.tsx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/state/shell/progress-guide.tsx b/src/state/shell/progress-guide.tsx index d10d58297..c9b42a263 100644 --- a/src/state/shell/progress-guide.tsx +++ b/src/state/shell/progress-guide.tsx @@ -59,11 +59,13 @@ export function useProgressGuideControls() { export function Provider({children}: React.PropsWithChildren<{}>) { const {_} = useLingui() const {data: preferences} = usePreferencesQuery() - const {mutateAsync, variables} = useSetActiveProgressGuideMutation() + const {mutateAsync, variables, isPending} = + useSetActiveProgressGuideMutation() const gate = useGate() - const activeProgressGuide = (variables || - preferences?.bskyAppState?.activeProgressGuide) as ProgressGuide + const activeProgressGuide = ( + isPending ? variables : preferences?.bskyAppState?.activeProgressGuide + ) as ProgressGuide // ensure the unspecced attributes have the correct types if (activeProgressGuide?.guide === 'like-10-and-follow-7') { @@ -103,11 +105,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) { }, endProgressGuide() { - // update the persisted first - mutateAsync(undefined).then(() => { - // now clear local state, to avoid rehydrating from the server - setLocalGuideState(undefined) - }) + setLocalGuideState(undefined) + mutateAsync(undefined) }, captureAction(action: ProgressGuideAction, count = 1) { |