From 5c606fe45f4cb711e10b7453939aca1dcf6a9ff1 Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Tue, 4 Mar 2025 10:39:40 -0800 Subject: [PATCH] improvement: replace window reload with query refetch --- .../SecretScanningPage/SecretScanningPage.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/organization/SecretScanningPage/SecretScanningPage.tsx b/frontend/src/pages/organization/SecretScanningPage/SecretScanningPage.tsx index 58e04e87c..ba919cdd3 100644 --- a/frontend/src/pages/organization/SecretScanningPage/SecretScanningPage.tsx +++ b/frontend/src/pages/organization/SecretScanningPage/SecretScanningPage.tsx @@ -72,8 +72,11 @@ export const SecretScanningPage = withPermission( const { mutateAsync: linkGitAppInstallationWithOrganization } = useLinkGitAppInstallationWithOrg(); const { mutateAsync: createNewIntegrationSession } = useCreateNewInstallationSession(); - const { data: installationStatus, isPending: isSecretScanningInstatllationStatusLoading } = - useGetSecretScanningInstallationStatus(organizationId); + const { + data: installationStatus, + isPending: isSecretScanningInstatllationStatusLoading, + refetch: refetchSecretScanningInstallationStatus + } = useGetSecretScanningInstallationStatus(organizationId); const integrationEnabled = !isSecretScanningInstatllationStatusLoading && installationStatus?.appInstallationCompleted; @@ -91,7 +94,7 @@ export const SecretScanningPage = withPermission( await navigate({ to: "/organization/secret-scanning" }); - window.location.reload(); + refetchSecretScanningInstallationStatus(); } console.log("installation verification complete");