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:
Yura Zenevich 2020-05-06 17:52:12 +00:00
Родитель 8dbb0d9be2
Коммит 698b98c243
1 изменённых файлов: 5 добавлений и 13 удалений

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

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