[APP-1013] Configure and apply default post interaction settings from user preferences (#7664)
* Add interaction settings screen * Move header out of interaction settings form * WIP hook it up * Thread through default settings into composer * Update copy pasta * Handle edited state * Copy feedback * Sentence case Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * Update copy * Bump SDK * Fix new type error * Less in your face * Remove new dep * Add slot * Copy edit --------- Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import {AppBskyActorDefs} from '@atproto/api'
|
||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {preferencesQueryKey} from '#/state/queries/preferences'
|
||||
import {useAgent} from '#/state/session'
|
||||
|
||||
export function usePostInteractionSettingsMutation() {
|
||||
const qc = useQueryClient()
|
||||
const agent = useAgent()
|
||||
return useMutation({
|
||||
async mutationFn(props: AppBskyActorDefs.PostInteractionSettingsPref) {
|
||||
await agent.setPostInteractionSettings(props)
|
||||
},
|
||||
async onSuccess() {
|
||||
await qc.invalidateQueries({
|
||||
queryKey: preferencesQueryKey,
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -39,4 +39,8 @@ export const DEFAULT_LOGGED_OUT_PREFERENCES: UsePreferencesQueryResponse = {
|
||||
activeProgressGuide: undefined,
|
||||
nuxs: [],
|
||||
},
|
||||
postInteractionSettings: {
|
||||
threadgateAllowRules: undefined,
|
||||
postgateEmbeddingRules: [],
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user