mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 23:27:14 +00:00
fix: patched auto bot removal for integration
This commit is contained in:
@@ -84,6 +84,8 @@ export const IntegrationsPage = withProjectPermission(
|
|||||||
reset: resetDeleteIntegrationAuth
|
reset: resetDeleteIntegrationAuth
|
||||||
} = useDeleteIntegrationAuth();
|
} = useDeleteIntegrationAuth();
|
||||||
|
|
||||||
|
const isIntegrationsAuthorizedEmpty = !Object.keys(integrationAuths || {}).length;
|
||||||
|
const isIntegrationsEmpty = !integrations?.length;
|
||||||
// summary: this use effect is trigger when all integration auths are removed thus deactivate bot
|
// summary: this use effect is trigger when all integration auths are removed thus deactivate bot
|
||||||
// details: so on successfully deleting an integration auth, immediately integration list is refeteched
|
// details: so on successfully deleting an integration auth, immediately integration list is refeteched
|
||||||
// After the refetch is completed check if its empty. Then set bot active and reset the submit hook for isSuccess to go back to false
|
// After the refetch is completed check if its empty. Then set bot active and reset the submit hook for isSuccess to go back to false
|
||||||
@@ -92,8 +94,8 @@ export const IntegrationsPage = withProjectPermission(
|
|||||||
isDeleteIntegrationAuthSuccess &&
|
isDeleteIntegrationAuthSuccess &&
|
||||||
!isIntegrationFetching &&
|
!isIntegrationFetching &&
|
||||||
!isIntegrationAuthFetching &&
|
!isIntegrationAuthFetching &&
|
||||||
!integrations?.length &&
|
isIntegrationsAuthorizedEmpty &&
|
||||||
!integrationAuths?.length
|
isIntegrationsEmpty
|
||||||
) {
|
) {
|
||||||
if (bot?._id)
|
if (bot?._id)
|
||||||
updateBotActiveStatusSync({
|
updateBotActiveStatusSync({
|
||||||
@@ -107,8 +109,8 @@ export const IntegrationsPage = withProjectPermission(
|
|||||||
isIntegrationFetching,
|
isIntegrationFetching,
|
||||||
isDeleteIntegrationAuthSuccess,
|
isDeleteIntegrationAuthSuccess,
|
||||||
isIntegrationAuthFetching,
|
isIntegrationAuthFetching,
|
||||||
integrationAuths?.length,
|
isIntegrationsAuthorizedEmpty,
|
||||||
integrations?.length
|
isIntegrationsEmpty
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const handleProviderIntegration = async (provider: string) => {
|
const handleProviderIntegration = async (provider: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user