From 39c9c1ba09072ebd1f06b5b6f6853cad86ef77f6 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 16 Mar 2023 11:54:09 -0400 Subject: [PATCH] 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. --- spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx index 413a7d35..5c1803f7 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx @@ -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);