1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
Zhiyuan Zheng
2021-01-23 02:41:50 +01:00
parent aa467f6911
commit 86231fb7b7
36 changed files with 614 additions and 481 deletions

View File

@ -1,7 +1,10 @@
import client from '@api/client'
import NetInfo from '@react-native-community/netinfo'
import { store } from '@root/store'
import { localRemoveInstance } from '@utils/slices/instancesSlice'
import {
localRemoveInstance,
localUpdateAccount
} from '@utils/slices/instancesSlice'
import log from './log'
const netInfo = async (): Promise<{
@ -31,6 +34,12 @@ const netInfo = async (): Promise<{
store.dispatch(localRemoveInstance(activeIndex))
return Promise.resolve({ connected: true, corruputed: '' })
} else {
store.dispatch(
localUpdateAccount({
acct: res.acct,
avatarStatic: res.avatar_static
})
)
return Promise.resolve({ connected: true })
}
})