Skip to content

Commit

Permalink
#117 fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor-postek-m2ms committed Mar 2, 2020
1 parent 9386c6d commit 1e3d34c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 5 additions & 2 deletions js/components/landing/Landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created by ricgillams on 21/06/2018.
*/
import { Grid } from '@material-ui/core';
import React, { memo, useEffect } from 'react';
import React, { memo, useEffect, useState } from 'react';
import TargetList from '../target/targetList';
import SessionList from '../session/sessionList';
import { connect } from 'react-redux';
Expand All @@ -11,6 +11,7 @@ import * as selectionActions from '../../reducers/selection/actions';
import { DJANGO_CONTEXT } from '../../utils/djangoContext';

const Landing = memo(({ resetSelectionState, resetTargetState }) => {
const [state, setState] = useState();
let text_div;

if (DJANGO_CONTEXT['authenticated'] === true) {
Expand Down Expand Up @@ -38,7 +39,9 @@ const Landing = memo(({ resetSelectionState, resetTargetState }) => {
<Grid item>
<h1
onClick={() => {
throw new Error('my custom error');
setState(() => {
throw Error('my custom error');
});
}}
>
Welcome to Fragalysis
Expand Down
11 changes: 10 additions & 1 deletion js/components/session/withSessionManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,16 @@ export const withSessionManagement = WrappedComponent => {
setSnackBarTitle(null);
setHeaderNavbarTitle('');
};
}, [disableButtons, dispatch, sessionTitle, setHeaderNavbarTitle, setHeaderButtons, setSnackBarTitle, targetIdList, setSnackBarColor]);
}, [
disableButtons,
dispatch,
sessionTitle,
setHeaderNavbarTitle,
setHeaderButtons,
setSnackBarTitle,
targetIdList,
setSnackBarColor
]);

return <WrappedComponent {...rest} />;
});
Expand Down

0 comments on commit 1e3d34c

Please sign in to comment.