Skip to content

Commit aba6e8d

Browse files
authored
Remove isWorkflowsPage check (#1047)
1 parent 0c3b3dd commit aba6e8d

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

Diff for: src/lib/stores/workflows.ts

+19-27
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,18 @@ import {
88
import { withLoading } from '$lib/utilities/stores/with-loading';
99

1010
import type { StartStopNotifier } from 'svelte/store';
11-
import { publicPath } from '$lib/utilities/get-public-path';
1211
import { supportsAdvancedVisibility } from './bulk-actions';
1312

1413
export const refresh = writable(0);
14+
1515
const namespace = derived([page], ([$page]) => $page.params.namespace);
1616
const query = derived([page], ([$page]) => $page.url.searchParams.get('query'));
17-
const path = derived([page], ([$page]) => $page.url.pathname);
18-
1917
const parameters = derived(
20-
[namespace, query, path, refresh, supportsAdvancedVisibility],
21-
([$namespace, $query, $path, $refresh, $supportsAdvancedVisibility]) => {
18+
[namespace, query, refresh, supportsAdvancedVisibility],
19+
([$namespace, $query, $refresh, $supportsAdvancedVisibility]) => {
2220
return {
2321
namespace: $namespace,
2422
query: $query,
25-
path: $path,
2623
refresh: $refresh,
2724
supportsAdvancedVisibility: $supportsAdvancedVisibility,
2825
};
@@ -35,29 +32,24 @@ const setCounts = (_workflowCount: { totalCount: number; count: number }) => {
3532

3633
const updateWorkflows: StartStopNotifier<WorkflowExecution[]> = (set) => {
3734
return parameters.subscribe(
38-
({ namespace, query, path, supportsAdvancedVisibility }) => {
39-
const isWorkflowsPage =
40-
path == `${publicPath}/namespaces/${namespace}/workflows`;
41-
42-
if (isWorkflowsPage) {
43-
withLoading(loading, updating, async () => {
44-
const { workflows, error } = await fetchAllWorkflows(namespace, {
45-
query,
46-
});
47-
set(workflows);
35+
({ namespace, query, supportsAdvancedVisibility }) => {
36+
withLoading(loading, updating, async () => {
37+
const { workflows, error } = await fetchAllWorkflows(namespace, {
38+
query,
39+
});
40+
set(workflows);
4841

49-
if (supportsAdvancedVisibility) {
50-
const workflowCount = await fetchWorkflowCount(namespace, query);
51-
setCounts(workflowCount);
52-
}
42+
if (supportsAdvancedVisibility) {
43+
const workflowCount = await fetchWorkflowCount(namespace, query);
44+
setCounts(workflowCount);
45+
}
5346

54-
if (error) {
55-
workflowError.set(error);
56-
} else {
57-
workflowError.set('');
58-
}
59-
});
60-
}
47+
if (error) {
48+
workflowError.set(error);
49+
} else {
50+
workflowError.set('');
51+
}
52+
});
6153
},
6254
);
6355
};

0 commit comments

Comments
 (0)