Skip to content

The open alternative to Salesforce, designed for AI.

Stop the core workflow index from swapping its empty state for a bare table (#26959)

Thomas Trompetteccda5c381c7a
diff --git a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflows.ts b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflows.ts
index 270fbda46ad..1ac7f501421 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflows.ts
+++ b/packages/twenty-front/src/modules/object-core/workflows/hooks/useCoreWorkflows.ts
@@ -1,6 +1,7 @@
import { useCallback, useState } from 'react';
import { useQuery } from '@apollo/client/react';
+import { isDefined } from 'twenty-shared/utils';
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { coreWorkflowsFilterSettingsState } from '@/object-core/workflows/states/coreWorkflowsFilterSettingsState';
@@ -170,6 +171,7 @@ export const useCoreWorkflows = ({
fetchNextPage,
refetchLoadedCoreWorkflows,
loading,
+ isInitialLoading: loading && !isDefined(connection),
error,
};
};
diff --git a/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx b/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx
index b1d16e60a19..a25faccd4da 100644
--- a/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx
+++ b/packages/twenty-front/src/pages/object-core/WorkflowCoreIndexPage.tsx
@@ -62,6 +62,7 @@ export const WorkflowCoreIndexPage = () => {
coreWorkflows,
hasNextPage,
loading,
+ isInitialLoading,
error,
fetchNextPage,
refetchLoadedCoreWorkflows,
@@ -88,7 +89,7 @@ export const WorkflowCoreIndexPage = () => {
const hasError = isDefined(error);
const isEmpty =
- !loading &&
+ !isInitialLoading &&
!hasError &&
!hasNextPage &&
displayedCoreWorkflows.length === 0;
@@ -160,7 +161,7 @@ export const WorkflowCoreIndexPage = () => {
}
/>
)}
- {!hasError && !isEmpty && (
+ {!isInitialLoading && !hasError && !isEmpty && (
<>
<CoreObjectTable
tableId={tableId}