Skip to content

Commit d342c71

Browse files
committed
clone data, don't mutate
this fixes the issue with seeing multiple errors
1 parent d14047c commit d342c71

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/components/error/GlobalErrorOverlay.react.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, {Component} from 'react';
22
import PropTypes from 'prop-types';
3+
import {concat} from 'ramda';
34

45
import './GlobalErrorOverlay.css';
56
import {FrontEndErrorContainer} from './FrontEnd/FrontEndErrorContainer.react';
@@ -14,14 +15,10 @@ export default class GlobalErrorOverlay extends Component {
1415

1516
let frontEndErrors;
1617
if (toastsEnabled) {
17-
let errors = [];
18-
if (error.frontEnd.length) {
19-
errors = error.frontEnd;
20-
}
21-
22-
error.backEnd.forEach(backEndError => {
23-
errors.push(backEndError);
24-
});
18+
const errors = concat(
19+
error.frontEnd,
20+
error.backEnd
21+
);
2522

2623
frontEndErrors = (
2724
<FrontEndErrorContainer errors={errors} resolve={resolve} />

0 commit comments

Comments
 (0)