зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1576318 Part 3 - Avoid rerendering messages when the paused execution point has not changed, r=loganfsmyth,nchevobbe.
Depends on D43319 Differential Revision: https://phabricator.services.mozilla.com/D43320 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
fe92dccb84
Коммит
f8e6ccaf6b
|
@ -22,7 +22,7 @@ const {
|
|||
MESSAGE_CLOSE,
|
||||
MESSAGE_TYPE,
|
||||
MESSAGE_UPDATE_PAYLOAD,
|
||||
PAUSED_EXCECUTION_POINT,
|
||||
PAUSED_EXECUTION_POINT,
|
||||
PRIVATE_MESSAGES_CLEAR,
|
||||
} = require("../constants");
|
||||
|
||||
|
@ -68,7 +68,7 @@ function messagesClearLogpoint(logpointId) {
|
|||
|
||||
function setPauseExecutionPoint(executionPoint) {
|
||||
return {
|
||||
type: PAUSED_EXCECUTION_POINT,
|
||||
type: PAUSED_EXECUTION_POINT,
|
||||
executionPoint,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ const actionTypes = {
|
|||
REVERSE_SEARCH_INPUT_CHANGE: "REVERSE_SEARCH_INPUT_CHANGE",
|
||||
REVERSE_SEARCH_NEXT: "REVERSE_SEARCH_NEXT",
|
||||
REVERSE_SEARCH_BACK: "REVERSE_SEARCH_BACK",
|
||||
PAUSED_EXCECUTION_POINT: "PAUSED_EXCECUTION_POINT",
|
||||
PAUSED_EXECUTION_POINT: "PAUSED_EXECUTION_POINT",
|
||||
WARNING_GROUPS_TOGGLE: "WARNING_GROUPS_TOGGLE",
|
||||
WILL_NAVIGATE: "WILL_NAVIGATE",
|
||||
EDITOR_SET_WIDTH: "EDITOR_SET_WIDTH",
|
||||
|
|
|
@ -375,7 +375,14 @@ function messages(
|
|||
|
||||
let newState;
|
||||
switch (action.type) {
|
||||
case constants.PAUSED_EXCECUTION_POINT:
|
||||
case constants.PAUSED_EXECUTION_POINT:
|
||||
if (
|
||||
state.pausedExecutionPoint &&
|
||||
action.executionPoint &&
|
||||
pointEquals(state.pausedExecutionPoint, action.executionPoint)
|
||||
) {
|
||||
return state;
|
||||
}
|
||||
return { ...state, pausedExecutionPoint: action.executionPoint };
|
||||
case constants.MESSAGES_ADD:
|
||||
// Preemptively remove messages that will never be rendered
|
||||
|
|
Загрузка…
Ссылка в новой задаче