mirror of
https://github.com/tooot-app/app
synced 2025-04-02 20:51:28 +02:00
https://github.com/tooot-app/app/issues/306 https://github.com/tooot-app/app/issues/305 This one uses the positive filtering that is added since v3.5, that a such a filter won't be shown as there is no way to check if a user is an admin or not and showing a useless option for majority users won't be a good experience.
34 lines
1020 B
TypeScript
34 lines
1020 B
TypeScript
import queryClient from '@helpers/queryClient'
|
|
import { store } from '@root/store'
|
|
import { InstanceLatest } from './migrations/instances/migration'
|
|
// import { prefetchTimelineQuery } from './queryHooks/timeline'
|
|
import { updateInstanceActive } from './slices/instancesSlice'
|
|
|
|
const initQuery = async ({
|
|
instance,
|
|
prefetch
|
|
}: {
|
|
instance: InstanceLatest
|
|
prefetch?: { enabled: boolean; page?: 'Following' | 'LocalPublic' }
|
|
}) => {
|
|
store.dispatch(updateInstanceActive(instance))
|
|
await queryClient.resetQueries()
|
|
|
|
// if (prefetch?.enabled && instance.timelinesLookback) {
|
|
// if (
|
|
// prefetch.page &&
|
|
// instance.timelinesLookback[prefetch.page]?.ids?.length > 0
|
|
// ) {
|
|
// await prefetchTimelineQuery(instance.timelinesLookback[prefetch.page])
|
|
// }
|
|
|
|
// for (const page of Object.keys(instance.timelinesLookback)) {
|
|
// if (page !== prefetch.page) {
|
|
// prefetchTimelineQuery(instance.timelinesLookback[page])
|
|
// }
|
|
// }
|
|
// }
|
|
}
|
|
|
|
export default initQuery
|