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-02-11 01:33:31 +01:00
parent a40a645337
commit d1bddc696a
50 changed files with 271 additions and 269 deletions

View File

@ -44,13 +44,13 @@ export type InstancesState = {
export const updateLocalAccountPreferences = createAsyncThunk(
'instances/updateLocalAccountPreferences',
async (): Promise<Mastodon.Preferences> => {
const preferences = await client<Mastodon.Preferences>({
const res = await client<Mastodon.Preferences>({
method: 'get',
instance: 'local',
url: `preferences`
})
return Promise.resolve(preferences)
return Promise.resolve(res.body)
}
)
@ -73,7 +73,9 @@ export const localAddInstance = createAsyncThunk(
const instanceLocal: InstancesState['local'] = store.getState().instances
.local
const { id, acct, avatar_static } = await client<Mastodon.Account>({
const {
body: { id, acct, avatar_static }
} = await client<Mastodon.Account>({
method: 'get',
instance: 'remote',
instanceDomain: url,
@ -100,7 +102,7 @@ export const localAddInstance = createAsyncThunk(
type = 'add'
}
const preferences = await client<Mastodon.Preferences>({
const { body: preferences } = await client<Mastodon.Preferences>({
method: 'get',
instance: 'remote',
instanceDomain: url,