Skip to content

Commit b2076dd

Browse files
committed
Fix diff bug crashing /diff UI
1 parent 9c5e65e commit b2076dd

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

src/components/diff-container.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export default class DiffContainer extends React.Component {
4545
};
4646

4747
errorHandled = (errorCode) => {
48-
console.log('Error handled:', errorCode);
4948
this.setState({ error: errorCode });
5049
};
5150

src/components/diff-view.jsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,11 @@ export default class DiffView extends React.Component {
208208
url.searchParams.append('b', b);
209209
fetchWithTimeout(url, { credentials: 'include' })
210210
.then(checkResponse)
211-
.then((response) => {
212-
if (response.status == 200) {
213-
const data = response.json();
214-
this.setState({
215-
diffData: data
216-
});
217-
} else {
218-
this._errorHandled(error.status);
219-
}
211+
.then(response => response.json())
212+
.then((data) => {
213+
this.setState({
214+
diffData: data
215+
});
220216
})
221217
.catch(error => { this._errorHandled(error.message); });
222218
}

0 commit comments

Comments
 (0)