Skip to content

Commit

Permalink
fix(ui): ListWatch should not _both_ set and depend on nextOffset (
Browse files Browse the repository at this point in the history
…#12672)

Signed-off-by: Anton Gilgur <agilgur5@gmail.com>
  • Loading branch information
agilgur5 committed Feb 17, 2024
1 parent 8ebf433 commit 030d581
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ui/src/app/shared/components/pagination-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function PaginationPanel(props: {pagination: Pagination; onChange: (pagin
// we should not skip any by setting an offset.
// The offset must be initialized whenever the pagination limit is changed.
if (limit) {
newValue.offset = '';
newValue.offset = undefined;
}

props.onChange(newValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export function WorkflowsList({match, location, history}: RouteComponentProps<an

const [namespace, setNamespace] = useState(Utils.getNamespace(match.params.namespace) || '');
const [pagination, setPagination] = useState<Pagination>(() => {
const savedPaginationLimit = storage.getItem('options', {}).paginationLimit || 0;
const savedPaginationLimit = storage.getItem('options', {}).paginationLimit || undefined;
return {
offset: queryParams.get('name'),
offset: queryParams.get('offset') || undefined,
limit: parseLimit(queryParams.get('limit')) || savedPaginationLimit || 50
};
});
Expand Down Expand Up @@ -155,7 +155,7 @@ export function WorkflowsList({match, location, history}: RouteComponentProps<an
clearSelectedWorkflows();
listWatch.stop();
};
}, [namespace, phases.toString(), labels.toString(), pagination.limit, pagination.offset, pagination.nextOffset]); // referential equality, so use values, not refs
}, [namespace, phases.toString(), labels.toString(), pagination.limit, pagination.offset]); // referential equality, so use values, not refs

useCollectEvent('openedWorkflowList');

Expand Down

0 comments on commit 030d581

Please sign in to comment.