about summary refs log tree commit diff
path: root/src/view/com/modals/DeleteAccount.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-05-08 03:10:03 +0100
committerGitHub <noreply@github.com>2024-05-08 03:10:03 +0100
commit0c41b3188a4f4ffc701b980d98e3e7560ee2bc7b (patch)
tree1e3b1133f743de7e9272ef0be007989b8565294b /src/view/com/modals/DeleteAccount.tsx
parent31a8356aef278414d4e70985ddbf3f76e6a455f1 (diff)
downloadvoidsky-0c41b3188a4f4ffc701b980d98e3e7560ee2bc7b.tar.zst
[Session] Remove global agent (#3852)
* Remove logs and outdated comments

* Move side effect upwards

* Pull refreshedAccount next to usage

* Simplify account refresh logic

* Extract setupPublicAgentState()

* Collapse setStates into one

* Ignore events from stale agents

* Use agent from state

* Remove clearCurrentAccount

* Move state to a reducer

* Remove global agent

* Fix stale agent reference in create flow

* Proceed to onboarding even if setting date fails

---------

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.tsx3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/view/com/modals/DeleteAccount.tsx b/src/view/com/modals/DeleteAccount.tsx
index 2e23a46b0..0e3bb6a4b 100644
--- a/src/view/com/modals/DeleteAccount.tsx
+++ b/src/view/com/modals/DeleteAccount.tsx
@@ -31,7 +31,7 @@ export function Component({}: {}) {
   const theme = useTheme()
   const {currentAccount} = useSession()
   const {getAgent} = useAgent()
-  const {clearCurrentAccount, removeAccount} = useSessionApi()
+  const {removeAccount} = useSessionApi()
   const {_} = useLingui()
   const {closeModal} = useModalControls()
   const {isMobile} = useWebMediaQueries()
@@ -69,7 +69,6 @@ export function Component({}: {}) {
       Toast.show(_(msg`Your account has been deleted`))
       resetToTab('HomeTab')
       removeAccount(currentAccount)
-      clearCurrentAccount()
       closeModal()
     } catch (e: any) {
       setError(cleanError(e))