[🐴] 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:
Samuel Newman 2024-05-17 20:24:06 +01:00 committed by GitHub
parent 115041f4bf
commit dd0f57e3e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 210 additions and 4 deletions

View file

@ -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
},
})
}