From 37d09abad9f9a2026f30d64a87d2adb5b62859e3 Mon Sep 17 00:00:00 2001 From: Alex P Date: Thu, 22 Mar 2018 21:06:09 -0700 Subject: [PATCH] Use notify when flushing error queue if error type is object --- ui/src/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/src/index.js b/ui/src/index.js index 4ea8b15e4..bffb167ac 100644 --- a/ui/src/index.js +++ b/ui/src/index.js @@ -40,6 +40,7 @@ import {getMeAsync} from 'shared/actions/auth' import {disablePresentationMode} from 'shared/actions/app' import {errorThrown} from 'shared/actions/errors' +import {notify} from 'shared/actions/notifications' import 'src/style/chronograf.scss' @@ -115,8 +116,12 @@ const Root = React.createClass({ flushErrorsQueue() { if (errorsQueue.length) { - errorsQueue.forEach(errorText => { - dispatch(errorThrown({status: 0, auth: null}, errorText, 'warning')) + errorsQueue.forEach(error => { + if (typeof error === 'object') { + dispatch(notify(error)) + } else { + dispatch(errorThrown({status: 0, auth: null}, error, 'warning')) + } }) } },