diff options
author | dan <dan.abramov@gmail.com> | 2024-05-08 23:11:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-08 23:11:39 +0100 |
commit | 0c6bf276dd43762cb36541d278f95dceb1c35896 (patch) | |
tree | a6e4ae3a3d01412c87ee1ee2c3e9d2d61f987b9c /src/view/com/modals/ChangeHandle.tsx | |
parent | f62b0458a742dc7e00c5ca75064718bc6fef53b7 (diff) | |
download | voidsky-0c6bf276dd43762cb36541d278f95dceb1c35896.tar.zst |
Replace updateCurrentAccount() with refreshSession() (#3910)
Replace updateCurrentAccount() with resumeSession()
Diffstat (limited to 'src/view/com/modals/ChangeHandle.tsx')
-rw-r--r-- | src/view/com/modals/ChangeHandle.tsx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/view/com/modals/ChangeHandle.tsx b/src/view/com/modals/ChangeHandle.tsx index ea49a93f2..52eb51031 100644 --- a/src/view/com/modals/ChangeHandle.tsx +++ b/src/view/com/modals/ChangeHandle.tsx @@ -15,12 +15,7 @@ import {logger} from '#/logger' import {useModalControls} from '#/state/modals' import {useFetchDid, useUpdateHandleMutation} from '#/state/queries/handle' import {useServiceQuery} from '#/state/queries/service' -import { - SessionAccount, - useAgent, - useSession, - useSessionApi, -} from '#/state/session' +import {SessionAccount, useAgent, useSession} from '#/state/session' import {useAnalytics} from 'lib/analytics/analytics' import {usePalette} from 'lib/hooks/usePalette' import {cleanError} from 'lib/strings/errors' @@ -73,10 +68,10 @@ export function Inner({ const {_} = useLingui() const pal = usePalette('default') const {track} = useAnalytics() - const {updateCurrentAccount} = useSessionApi() const {closeModal} = useModalControls() const {mutateAsync: updateHandle, isPending: isUpdateHandlePending} = useUpdateHandleMutation() + const {getAgent} = useAgent() const [error, setError] = useState<string>('') @@ -116,9 +111,7 @@ export function Inner({ await updateHandle({ handle: newHandle, }) - updateCurrentAccount({ - handle: newHandle, - }) + await getAgent().resumeSession(getAgent().session!) closeModal() onChanged() } catch (err: any) { @@ -134,9 +127,9 @@ export function Inner({ onChanged, track, closeModal, - updateCurrentAccount, updateHandle, serviceInfo, + getAgent, ]) // rendering |