From 41013daa0b86a450ade9cdac911ccdb7722eb473 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Wed, 27 Jan 2016 10:07:26 -0500 Subject: Fixing small issue with displaying activity log --- web/react/components/activity_log_modal.jsx | 4 ++-- web/react/components/error_bar.jsx | 1 + web/react/stores/error_store.jsx | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/react/components/activity_log_modal.jsx b/web/react/components/activity_log_modal.jsx index eec4d8f8d..2c42f5971 100644 --- a/web/react/components/activity_log_modal.jsx +++ b/web/react/components/activity_log_modal.jsx @@ -100,10 +100,10 @@ export default class ActivityLogModal extends React.Component { if (currentSession.props.platform === 'Windows') { devicePicture = 'fa fa-windows'; - } else if (currentSession.device_id.indexOf('apple:') === 0) { + } else if (currentSession.device_id && currentSession.device_id.indexOf('apple:') === 0) { devicePicture = 'fa fa-apple'; devicePlatform = 'iPhone Native App'; - } else if (currentSession.device_id.indexOf('android:') === 0) { + } else if (currentSession.device_id && currentSession.device_id.indexOf('android:') === 0) { devicePlatform = 'Android Native App'; devicePicture = 'fa fa-android'; } else if (currentSession.props.platform === 'Macintosh' || diff --git a/web/react/components/error_bar.jsx b/web/react/components/error_bar.jsx index e93545c25..27d885aa8 100644 --- a/web/react/components/error_bar.jsx +++ b/web/react/components/error_bar.jsx @@ -82,6 +82,7 @@ export default class ErrorBar extends React.Component { e.preventDefault(); } + ErrorStore.clearLastError(); this.setState({message: null}); } diff --git a/web/react/stores/error_store.jsx b/web/react/stores/error_store.jsx index 69d6cca7f..ed46d6b68 100644 --- a/web/react/stores/error_store.jsx +++ b/web/react/stores/error_store.jsx @@ -46,6 +46,10 @@ class ErrorStoreClass extends EventEmitter { storeLastError(error) { BrowserStore.setItem('last_error', error); } + + clearLastError() { + BrowserStore.removeItem('last_error'); + } } var ErrorStore = new ErrorStoreClass(); -- cgit v1.2.3-1-g7c22