From b8ecb06322264001882d517c90c19ae852553de2 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 4 Apr 2024 12:56:00 -0500 Subject: [PATCH] Use resumeSession to get email confirmation data --- src/state/session/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/state/session/index.tsx b/src/state/session/index.tsx index 102ab9721b..203ba0c4bf 100644 --- a/src/state/session/index.tsx +++ b/src/state/session/index.tsx @@ -466,11 +466,12 @@ export function Provider({children}: React.PropsWithChildren<{}>) { const refreshSession = React.useCallback< ApiContext['refreshSession'] >(async () => { - await agent.refreshSession() + if (!currentAccount) return + await agent.resumeSession(sessionAccountToAgentSession(currentAccount)!) persistNextUpdate() upsertAccount(agentToSessionAccount(agent)!) setAgent(agent.clone()) - }, [agent, setAgent, persistNextUpdate, upsertAccount]) + }, [currentAccount, agent, setAgent, persistNextUpdate, upsertAccount]) const selectAccount = React.useCallback( async (account, logContext) => {