Skip to content

Commit

Permalink
Update new-log-viewer/src/contexts/StateContextProvider.tsx
Browse files Browse the repository at this point in the history
Co-authored-by: Henry8192 <[email protected]>
  • Loading branch information
junhaoliao and Henry8192 authored Aug 19, 2024
1 parent 89eabea commit d7de3c1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions new-log-viewer/src/contexts/StateContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,12 @@ const StateContextProvider = ({children}: StateContextProviderProps) => {
numPagesRef.current
);

if (STATE_DEFAULT.pageNum !== pageNumRef.current) {
if (newPageNum === pageNumRef.current) {
// Don't need to switch pages so just update `logEventNum` in the URL.
updateLogEventNumInUrl(numEvents, logEventNumRef.current);
} else {
if (STATE_DEFAULT.pageNum === pageNumRef.current) {
return;
} else if (newPageNum === pageNumRef.current) {
// Don't need to switch pages so just update `logEventNum` in the URL.
updateLogEventNumInUrl(numEvents, logEventNumRef.current);
} else {
// This is not the initial page load, so request a page switch.
// NOTE: We don't need to call `updateLogEventNumInUrl()` since it's called when
// handling the `WORKER_RESP_CODE.PAGE_DATA` response (the response to
Expand Down

0 comments on commit d7de3c1

Please sign in to comment.