Skip to content

Commit

Permalink
Skip update AppState when no log updates (#4482)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurochan authored Jul 11, 2023
1 parent 99e6970 commit 06b8296
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/src/modules/stage-logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ export const stageLogsSlice = createSlice({
})
.addCase(fetchStageLog.fulfilled, (state, action) => {
const id = createActiveStageKey(action.meta.arg);
state[id] = action.payload;
// Skip update state when no log updates
// to avoid unnecessary state update and trigger re-render.
if (JSON.stringify(state[id]) !== JSON.stringify(action.payload)) {
state[id] = action.payload;
}
});
},
});
Expand Down

0 comments on commit 06b8296

Please sign in to comment.