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:
Brian Hackett 2019-08-30 17:07:07 +00:00
Родитель fe92dccb84
Коммит f8e6ccaf6b
3 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -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