Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Commit

Permalink
Using snackbar for error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
djenriquez committed Mar 3, 2017
1 parent 1c44b12 commit 395b75f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/components/shared/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ import FontIcon from 'material-ui/FontIcon';
import { browserHistory } from 'react-router';
import CountDown from './countdown.js'
import styles from './header.css';
import { callVaultApi } from '../../shared/VaultUtils.jsx'
import { callVaultApi } from '../../shared/VaultUtils.jsx';
import Snackbar from 'material-ui/Snackbar';


var logout = () => {
window.localStorage.removeItem('vaultAccessToken');
browserHistory.push('/login');
}

function snackBarMessage(message) {
let ev = new CustomEvent("snackbar", { detail: { message: message } });
document.dispatchEvent(ev);
}

class Header extends React.Component {
constructor(props) {
super(props);
Expand All @@ -40,7 +47,7 @@ class Header extends React.Component {
version: error.response.data.version,
});
} else {
throw error;
snackBarMessage(error);
}
});
}
Expand Down

0 comments on commit 395b75f

Please sign in to comment.