mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
The current add-ons page only lists a subset of available add-ons, which often causes confusion with things like Advanced MFA Auth (customers cant find where to configure it). The revised add-on page covers all potentially configured project add-ons including replicas and advanced disk. This should help the customer locate configured add-ons and at the same time discover potentially interesting add-ons. This can be enhanced further in the future with "smart" suggestions based on usage.
24 lines
915 B
TypeScript
24 lines
915 B
TypeScript
import type { QueryClient, QueryKey } from '@tanstack/react-query'
|
|
|
|
import { subscriptionKeys } from '../subscriptions/keys'
|
|
import { replicationKeys } from './keys'
|
|
|
|
const isPollingQuery = ({ queryKey }: { queryKey: QueryKey }) =>
|
|
queryKey.at(-1) === 'status' || queryKey.at(-1) === 'replication-status'
|
|
|
|
export const invalidateReplicationPipelineQueries = (
|
|
queryClient: QueryClient,
|
|
projectRef: string | undefined
|
|
) => {
|
|
const queryKey = replicationKeys.pipelines(projectRef)
|
|
return Promise.all([
|
|
queryClient.invalidateQueries({ queryKey, predicate: (query) => !isPollingQuery(query) }),
|
|
// Polls will refresh again after the current read; metadata needs a post-mutation read now.
|
|
queryClient.invalidateQueries(
|
|
{ queryKey, predicate: isPollingQuery },
|
|
{ cancelRefetch: false }
|
|
),
|
|
queryClient.invalidateQueries({ queryKey: subscriptionKeys.addons(projectRef) }),
|
|
])
|
|
}
|