[🐴] NUX (#4062)
* remove type assertion * DMs NUX * delete button for testing * tweak styles and copy * rm log * style tweaks * reduce amount of words * Fix not showing on first load * Spacing tweaks --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
parent
115041f4bf
commit
dd0f57e3e3
5 changed files with 210 additions and 4 deletions
|
@ -21,9 +21,9 @@ export function useUpdateActorDeclaration({
|
|||
if (!currentAccount) throw new Error('Not logged in')
|
||||
// TODO(sam): remove validate: false once PDSes have the new lexicon
|
||||
const result = await getAgent().api.com.atproto.repo.putRecord({
|
||||
repo: currentAccount.did,
|
||||
collection: 'chat.bsky.actor.declaration',
|
||||
rkey: 'self',
|
||||
repo: currentAccount.did,
|
||||
validate: false,
|
||||
record: {
|
||||
$type: 'chat.bsky.actor.declaration',
|
||||
|
@ -62,3 +62,23 @@ export function useUpdateActorDeclaration({
|
|||
},
|
||||
})
|
||||
}
|
||||
|
||||
// for use in the settings screen for testing
|
||||
export function useDeleteActorDeclaration() {
|
||||
const {currentAccount} = useSession()
|
||||
const {getAgent} = useAgent()
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async () => {
|
||||
if (!currentAccount) throw new Error('Not logged in')
|
||||
// TODO(sam): remove validate: false once PDSes have the new lexicon
|
||||
const result = await getAgent().api.com.atproto.repo.deleteRecord({
|
||||
repo: currentAccount.did,
|
||||
collection: 'chat.bsky.actor.declaration',
|
||||
rkey: 'self',
|
||||
validate: false,
|
||||
})
|
||||
return result
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue