Fix responsiveness of dismissing the progress guide (#4729)
parent
12bf796293
commit
d837f96478
|
@ -59,11 +59,13 @@ export function useProgressGuideControls() {
|
||||||
export function Provider({children}: React.PropsWithChildren<{}>) {
|
export function Provider({children}: React.PropsWithChildren<{}>) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const {data: preferences} = usePreferencesQuery()
|
const {data: preferences} = usePreferencesQuery()
|
||||||
const {mutateAsync, variables} = useSetActiveProgressGuideMutation()
|
const {mutateAsync, variables, isPending} =
|
||||||
|
useSetActiveProgressGuideMutation()
|
||||||
const gate = useGate()
|
const gate = useGate()
|
||||||
|
|
||||||
const activeProgressGuide = (variables ||
|
const activeProgressGuide = (
|
||||||
preferences?.bskyAppState?.activeProgressGuide) as ProgressGuide
|
isPending ? variables : preferences?.bskyAppState?.activeProgressGuide
|
||||||
|
) as ProgressGuide
|
||||||
|
|
||||||
// ensure the unspecced attributes have the correct types
|
// ensure the unspecced attributes have the correct types
|
||||||
if (activeProgressGuide?.guide === 'like-10-and-follow-7') {
|
if (activeProgressGuide?.guide === 'like-10-and-follow-7') {
|
||||||
|
@ -103,11 +105,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
||||||
},
|
},
|
||||||
|
|
||||||
endProgressGuide() {
|
endProgressGuide() {
|
||||||
// update the persisted first
|
setLocalGuideState(undefined)
|
||||||
mutateAsync(undefined).then(() => {
|
mutateAsync(undefined)
|
||||||
// now clear local state, to avoid rehydrating from the server
|
|
||||||
setLocalGuideState(undefined)
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
captureAction(action: ProgressGuideAction, count = 1) {
|
captureAction(action: ProgressGuideAction, count = 1) {
|
||||||
|
|
Loading…
Reference in New Issue