avoid the flicker when switching between detailed view and normal view by just clearing out the data before making a new request. The vast majority of the delay is not in the api call, but in rendering the data - and at just a split second, it isn't long enough for a spinner to be very effective.

This commit is contained in:
Dan 2023-03-16 11:54:09 -04:00
parent eef40bf22f
commit 39c9c1ba09
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ export default function ProcessInstanceLogList({ variant }: OwnProps) {
}
useEffect(() => {
// Clear out any previous results to avoid a "flicker" effect where columns
// are updated above the incorrect data.
setProcessInstanceLogs([]);
setPagination(null);
const setProcessInstanceLogListFromResult = (result: any) => {
setProcessInstanceLogs(result.results);
setPagination(result.pagination);