about summary refs log tree commit diff
path: root/src/view/com/modals/DeleteAccount.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-05-17 20:53:51 +0100
committerGitHub <noreply@github.com>2024-05-17 14:53:51 -0500
commitcef243bcf47235b16f0dba54c917fb8c37757c96 (patch)
treefea776570b6c5e526316b3efc1c710e2937a657c /src/view/com/modals/DeleteAccount.tsx
parentf42f7fa0353a45c6b20e65e1a54b64e1c28b0cd5 (diff)
downloadvoidsky-cef243bcf47235b16f0dba54c917fb8c37757c96.tar.zst
[🐴] delete chat service account on account delete (#4056)
* delete chat service account on account delete

* Add proxy header

---------

Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to 'src/view/com/modals/DeleteAccount.tsx')
-rw-r--r--src/view/com/modals/DeleteAccount.tsx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/view/com/modals/DeleteAccount.tsx b/src/view/com/modals/DeleteAccount.tsx
index 0e3bb6a4b..cab5dc289 100644
--- a/src/view/com/modals/DeleteAccount.tsx
+++ b/src/view/com/modals/DeleteAccount.tsx
@@ -11,6 +11,7 @@ import {msg, Trans} from '@lingui/macro'
 import {useLingui} from '@lingui/react'
 
 import {useModalControls} from '#/state/modals'
+import {DM_SERVICE_HEADERS} from '#/state/queries/messages/const'
 import {useAgent, useSession, useSessionApi} from '#/state/session'
 import {usePalette} from 'lib/hooks/usePalette'
 import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
@@ -61,6 +62,16 @@ export function Component({}: {}) {
     const token = confirmCode.replace(/\s/g, '')
 
     try {
+      // inform chat service of intent to delete account
+      const {success} = await getAgent().api.chat.bsky.actor.deleteAccount(
+        undefined,
+        {
+          headers: DM_SERVICE_HEADERS,
+        },
+      )
+      if (!success) {
+        throw new Error('Failed to inform chat service of account deletion')
+      }
       await getAgent().com.atproto.server.deleteAccount({
         did: currentAccount.did,
         password,