Skip to content

Commit

Permalink
feat: show error page when token is not returned
Browse files Browse the repository at this point in the history
  • Loading branch information
aquino-luane committed Oct 22, 2024
1 parent 7528680 commit c55f1ca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/containers/gui.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {injectIntl, intlShape} from 'react-intl';
import ErrorBoundaryHOC from '../lib/error-boundary-hoc.jsx';
import {
getIsError,
getIsShowingProject
getIsShowingProject,
projectError
} from '../reducers/project-state';
import {
activateTab,
Expand Down Expand Up @@ -73,9 +74,10 @@ class GUI extends React.Component {
})
.catch((error) => {
console.error(
'There was a problem with the fetch operation:',
'There was a problem with the fetch operation when fetching a token:',
error
);
this.props.onProjectError(error);
});
}
render () {
Expand All @@ -96,6 +98,7 @@ class GUI extends React.Component {
onUpdateProjectId,
onVmInit,
onSetSession,
onProjectError,
projectHost,
projectId,
/* eslint-enable no-unused-vars */
Expand Down Expand Up @@ -134,6 +137,7 @@ GUI.propTypes = {
onUpdateProjectId: PropTypes.func,
onVmInit: PropTypes.func,
onSetSession: PropTypes.func,
onProjectError: PropTypes.func,
projectHost: PropTypes.string,
projectId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
telemetryModalVisible: PropTypes.bool,
Expand Down Expand Up @@ -187,6 +191,7 @@ const mapDispatchToProps = dispatch => ({
onRequestCloseCostumeLibrary: () => dispatch(closeCostumeLibrary()),
onRequestCloseTelemetryModal: () => dispatch(closeTelemetryModal()),
onSetSession: (token) => dispatch(setSession(token)),
onProjectError: error => dispatch(projectError(error)),
});

const ConnectedGUI = injectIntl(connect(
Expand Down

0 comments on commit c55f1ca

Please sign in to comment.