Integration page can update to empty array (#5593)

This commit is contained in:
RachelElysia
2022-05-05 14:04:34 -04:00
committed by GitHub
parent 8fea14270c
commit 1899db5202
2 changed files with 4 additions and 1 deletions
@@ -0,0 +1 @@
* Bug fix: Integrations page updates to 0 integrations when the last integration is removed
@@ -82,6 +82,8 @@ const IntegrationsPage = (): JSX.Element => {
return { ...integration, index };
});
setIntegrationsIndexed(addIndex);
} else {
setIntegrationsIndexed([]);
}
},
}
@@ -195,6 +197,7 @@ const IntegrationsPage = (): JSX.Element => {
Successfully deleted <b>{integrationEditing.url}</b>
</>
);
refetchIntegrations();
})
.catch(() => {
renderFlash(
@@ -206,7 +209,6 @@ const IntegrationsPage = (): JSX.Element => {
);
})
.finally(() => {
refetchIntegrations();
toggleDeleteIntegrationModal();
});
}