mirror of
https://github.com/tooot-app/app
synced 2025-04-13 18:01:58 +02:00
Experiment support of Pleroma (#588)
This commit is contained in:
parent
29a092a925
commit
ca629befc9
@ -2,3 +2,4 @@ Enjoy toooting! This version includes following improvements and fixes:
|
||||
- Align filter experience with v4.0 and above
|
||||
- Supports enlarging user's avatar and banner
|
||||
- Fix iPad weird sizing (not optimisation)
|
||||
- Experiment (!) support of Pleroma
|
||||
|
@ -2,3 +2,4 @@ toooting愉快!此版本包括以下改进和修复:
|
||||
- 改进过滤体验,与v4.0以上版本一致
|
||||
- 支持查看用户的头像和横幅图片
|
||||
- 修复iPad部分尺寸问题(非优化)
|
||||
- 试验性(!)支持Pleroma
|
||||
|
@ -61,7 +61,7 @@ const ComponentHashtag: React.FC<PropsWithChildren & Props> = ({
|
||||
}) => setHeight(height)}
|
||||
>
|
||||
<Sparkline
|
||||
data={hashtag.history.map(h => parseInt(h.uses)).reverse()}
|
||||
data={hashtag.history?.map(h => parseInt(h.uses)).reverse()}
|
||||
width={width}
|
||||
height={height}
|
||||
margin={children ? StyleConstants.Spacing.S : undefined}
|
||||
|
@ -1,5 +1,21 @@
|
||||
import { QueryClient } from '@tanstack/react-query'
|
||||
|
||||
const queryClient = new QueryClient({ defaultOptions: { queries: { staleTime: 1000 * 60 * 5 } } })
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 1000 * 60 * 5,
|
||||
retry: (failureCount, error: any) => {
|
||||
if (error?.status === 404) {
|
||||
return false
|
||||
}
|
||||
if (failureCount <= 3) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export default queryClient
|
||||
|
@ -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>[]>({
|
||||
|
@ -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()
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user