From 1899db5202cf7efcdf727f2d7cbb87ada426d0d3 Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Thu, 5 May 2022 14:04:34 -0400 Subject: [PATCH] Integration page can update to empty array (#5593) --- changes/issue-5563-remove-last-integration | 1 + frontend/pages/admin/IntegrationsPage/IntegrationsPage.tsx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changes/issue-5563-remove-last-integration diff --git a/changes/issue-5563-remove-last-integration b/changes/issue-5563-remove-last-integration new file mode 100644 index 0000000000..7f5a644a8a --- /dev/null +++ b/changes/issue-5563-remove-last-integration @@ -0,0 +1 @@ +* Bug fix: Integrations page updates to 0 integrations when the last integration is removed \ No newline at end of file diff --git a/frontend/pages/admin/IntegrationsPage/IntegrationsPage.tsx b/frontend/pages/admin/IntegrationsPage/IntegrationsPage.tsx index 1b3d5af0eb..f55652a279 100644 --- a/frontend/pages/admin/IntegrationsPage/IntegrationsPage.tsx +++ b/frontend/pages/admin/IntegrationsPage/IntegrationsPage.tsx @@ -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 {integrationEditing.url} ); + refetchIntegrations(); }) .catch(() => { renderFlash( @@ -206,7 +209,6 @@ const IntegrationsPage = (): JSX.Element => { ); }) .finally(() => { - refetchIntegrations(); toggleDeleteIntegrationModal(); }); }