[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>
This commit is contained in:
parent
31a8356aef
commit
0c41b3188a
5 changed files with 265 additions and 360 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue