зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1635645 - check the action type before logging simulation related action errors. r=mtigley
Differential Revision: https://phabricator.services.mozilla.com/D73991
This commit is contained in:
Родитель
8dbb0d9be2
Коммит
698b98c243
|
@ -25,21 +25,13 @@ function getInitialState() {
|
|||
}
|
||||
|
||||
function simulation(state = getInitialState(), action) {
|
||||
const { error } = action;
|
||||
|
||||
if (error) {
|
||||
console.warn(
|
||||
`Error running simulation: ${
|
||||
typeof error == "string"
|
||||
? error
|
||||
: "simulate function in simulator.js returned an error"
|
||||
}`
|
||||
);
|
||||
switch (action.type) {
|
||||
case SIMULATE:
|
||||
if (action.error) {
|
||||
console.warn("Error running simulation", action.error);
|
||||
return state;
|
||||
}
|
||||
|
||||
switch (action.type) {
|
||||
case SIMULATE:
|
||||
const simTypes = action.simTypes;
|
||||
|
||||
if (simTypes.length === 0) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче