1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Experiment support of Pleroma (#588)

This commit is contained in:
xmflsct
2022-12-20 00:45:53 +01:00
committed by GitHub
parent 29a092a925
commit ca629befc9
7 changed files with 36 additions and 4 deletions

View File

@ -50,6 +50,12 @@ const addInstance = createAsyncThunk(
domain,
url: `api/v1/preferences`,
headers: { Authorization: `Bearer ${token}` }
}).catch(error => {
if (error?.status === 404) {
return Promise.resolve({ body: {} })
} else {
return Promise.reject()
}
})
const { body: filters } = await apiGeneral<Mastodon.Filter<any>[]>({

View File

@ -7,6 +7,14 @@ export const updateAccountPreferences = createAsyncThunk(
return apiInstance<Mastodon.Preferences>({
method: 'get',
url: `preferences`
}).then(res => res.body)
})
.then(res => res.body)
.catch(error => {
if (error?.status === 404) {
return Promise.resolve({})
} else {
return Promise.reject()
}
})
}
)

View File

@ -280,7 +280,7 @@ export const getInstanceUrl = ({ instances: { instances } }: RootState) =>
instances[findInstanceActive(instances)]?.url
export const getInstanceUri = ({ instances: { instances } }: RootState) =>
instances[findInstanceActive(instances)]?.uri
instances[findInstanceActive(instances)]?.uri.replace(/^https?:\/\//, '') // Pleroma has schema
export const getInstanceUrls = ({ instances: { instances } }: RootState) =>
instances[findInstanceActive(instances)]?.urls