Add setting for opting in to beta features (#11123)
This commit is contained in:
@@ -50,6 +50,7 @@ export const DEFAULT_LOGGED_OUT_PREFERENCES: UsePreferencesQueryResponse = {
|
||||
queuedNudges: [],
|
||||
activeProgressGuide: undefined,
|
||||
nuxs: [],
|
||||
isBetaUser: undefined,
|
||||
},
|
||||
postInteractionSettings: {
|
||||
threadgateAllowRules: undefined,
|
||||
|
||||
@@ -438,6 +438,21 @@ export function useSetActiveProgressGuideMutation() {
|
||||
})
|
||||
}
|
||||
|
||||
export function useSetIsBetaUserMutation() {
|
||||
const queryClient = useQueryClient()
|
||||
const agent = useAgent()
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async (isBetaUser: boolean) => {
|
||||
await agent.setIsBetaUser(isBetaUser)
|
||||
// triggers a refetch
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: preferencesQueryKey,
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export function useSetVerificationPrefsMutation() {
|
||||
const ax = useAnalytics()
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
Reference in New Issue
Block a user