Bluesky app fork with some witchin' additions 馃挮
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 8c3553cd66ad07ef8c8c4e760b495cf6ce08cc8d 29 lines 808 B view raw
1import {useMutation} from '@tanstack/react-query' 2 3import {useAgent, useSession} from '#/state/session' 4import {pdsAgent} from '#/state/session/agent' 5 6export function useConfirmEmail({ 7 onSuccess, 8 onError, 9}: {onSuccess?: () => void; onError?: () => void} = {}) { 10 const agent = useAgent() 11 const {currentAccount} = useSession() 12 13 return useMutation({ 14 mutationFn: async ({token}: {token: string}) => { 15 if (!currentAccount?.email) { 16 throw new Error('No email found for the current account') 17 } 18 19 await pdsAgent(agent).com.atproto.server.confirmEmail({ 20 email: currentAccount.email.trim(), 21 token: token.trim(), 22 }) 23 // will update session state at root of app 24 await agent.resumeSession(agent.session!) 25 }, 26 onSuccess, 27 onError, 28 }) 29}