Skip to content

Commit 6df6234

Browse files
malwilleyandrewshie-sentry
authored andcommitted
fix(aci): Wait for page filters before fetching automations list (#97639)
1 parent 5d7412a commit 6df6234

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

static/app/views/automations/list.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function AutomationsList() {
2828

2929
const location = useLocation();
3030
const navigate = useNavigate();
31-
const {selection} = usePageFilters();
31+
const {selection, isReady} = usePageFilters();
3232

3333
const {
3434
sort: sorts,
@@ -45,17 +45,20 @@ export default function AutomationsList() {
4545

4646
const {
4747
data: automations,
48-
isPending,
48+
isLoading,
4949
isError,
5050
isSuccess,
5151
getResponseHeader,
52-
} = useAutomationsQuery({
53-
cursor,
54-
query,
55-
sortBy: sort ? `${sort?.kind === 'asc' ? '' : '-'}${sort?.field}` : undefined,
56-
projects: selection.projects,
57-
limit: AUTOMATION_LIST_PAGE_LIMIT,
58-
});
52+
} = useAutomationsQuery(
53+
{
54+
cursor,
55+
query,
56+
sortBy: sort ? `${sort?.kind === 'asc' ? '' : '-'}${sort?.field}` : undefined,
57+
projects: selection.projects,
58+
limit: AUTOMATION_LIST_PAGE_LIMIT,
59+
},
60+
{enabled: isReady}
61+
);
5962

6063
const hits = getResponseHeader?.('X-Hits') || '';
6164
const hitsInt = hits ? parseInt(hits, 10) || 0 : 0;
@@ -81,7 +84,7 @@ export default function AutomationsList() {
8184
<div>
8285
<AutomationListTable
8386
automations={automations ?? []}
84-
isPending={isPending}
87+
isPending={isLoading}
8588
isError={isError}
8689
isSuccess={isSuccess}
8790
sort={sort}

0 commit comments

Comments
 (0)