Skip to content

Commit

Permalink
chore: disable kapis/config.kubesphere.io/v1alpha2/configs/marketplace (
Browse files Browse the repository at this point in the history
#4312)

Signed-off-by: donniean <[email protected]>
  • Loading branch information
donniean authored Sep 25, 2024
1 parent 473cc71 commit 653794f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/core/src/stores/marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@ function useMarketplaceConfigQuery(options?: UseMarketplaceConfigQueryOptions) {
const onSuccess = options?.onSuccess;

const result = useQuery({
enabled: false,
queryKey,
queryFn: () =>
request.get<never, OriginalMarketplaceConfig>(url, { headers }).then(formatMarketplaceConfig),
onSuccess: data => onSuccess?.(data),
});
const isSettled = result.isSuccess || result.isError;
// const isSettled = result.isSuccess || result.isError;
const formattedMarketplaceConfig = result.data;
const isOnline = isSettled ? Boolean(formattedMarketplaceConfig?.url) : undefined;
const isOffline = isSettled ? !isOnline : undefined;
// const isOnline = isSettled ? Boolean(formattedMarketplaceConfig?.url) : undefined;
// const isOffline = isSettled ? !isOnline : undefined;

return { ...result, formattedMarketplaceConfig, isOnline, isOffline };
return { ...result, formattedMarketplaceConfig, isOnline: false, isOffline: true };
}

interface UseMarketplaceCallbackQueryOptions {
Expand Down

0 comments on commit 653794f

Please sign in to comment.