mirror of
https://github.com/tooot-app/app
synced 2025-04-25 07:28:41 +02:00
Fix #697
This commit is contained in:
parent
0b3d206190
commit
8775a0cb25
@ -244,6 +244,12 @@ export const setAccount = async (account: string) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log('log', 'setAccount', `binding storage of ${account}`)
|
||||||
|
storage.account = temp
|
||||||
|
setGlobalStorage('account.active', account)
|
||||||
|
await queryClient.resetQueries()
|
||||||
|
queryClient.clear()
|
||||||
|
|
||||||
await apiGeneral<Mastodon.Account>({
|
await apiGeneral<Mastodon.Account>({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
domain,
|
domain,
|
||||||
@ -254,15 +260,10 @@ export const setAccount = async (account: string) => {
|
|||||||
})
|
})
|
||||||
.then(res => res.body)
|
.then(res => res.body)
|
||||||
.then(async a => {
|
.then(async a => {
|
||||||
temp.set('auth.account.acct', a.acct)
|
storage.account?.set('auth.account.acct', a.acct)
|
||||||
temp.set('auth.account.avatar_static', a.avatar_static)
|
storage.account?.set('auth.account.avatar_static', a.avatar_static)
|
||||||
|
|
||||||
log('log', 'setAccount', `binding storage of ${account}`)
|
log('log', 'setAccount', 'update details')
|
||||||
await queryClient.resetQueries()
|
|
||||||
queryClient.clear()
|
|
||||||
|
|
||||||
storage.account = temp
|
|
||||||
setGlobalStorage('account.active', account)
|
|
||||||
})
|
})
|
||||||
.catch(async error => {
|
.catch(async error => {
|
||||||
if (error?.status && error.status == 401) {
|
if (error?.status && error.status == 401) {
|
||||||
@ -302,7 +303,7 @@ export const removeAccount = async (account: string, warning: boolean = true) =>
|
|||||||
apiGeneral({
|
apiGeneral({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
domain: revokeDetails.domain,
|
domain: revokeDetails.domain,
|
||||||
url: '/oauth/revoke',
|
url: 'oauth/revoke',
|
||||||
body: revokeDetails
|
body: revokeDetails
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user