Merge pull request #1582 from influxdata/1580-fix/null_localstorage

Fix load localStorage and warning UX on fresh Chronograf install
pull/10616/head
Jared Scheib 2017-06-01 15:43:16 -07:00 committed by GitHub
commit cdde4ff4dc
2 changed files with 4 additions and 3 deletions

View File

@ -5,6 +5,7 @@
1. [#1535](https://github.com/influxdata/chronograf/pull/1535): Fix add field functions to existing Kapacitor rules
1. [#1564](https://github.com/influxdata/chronograf/pull/1564): Fix regression of logout menu item functionality
1. [#1562](https://github.com/influxdata/chronograf/pull/1562): Fix InfluxQL parsing with multiple tag values for a tag key
1. [#1582](https://github.com/influxdata/chronograf/pull/1582): Fix load localStorage and warning UX on fresh Chronograf install
### Features
1. [#1537](https://github.com/influxdata/chronograf/pull/1537): Add UI for writing data to influxdb.

View File

@ -2,10 +2,10 @@ export const loadLocalStorage = errorsQueue => {
try {
const serializedState = localStorage.getItem('state')
const state = JSON.parse(serializedState)
const state = JSON.parse(serializedState) || {}
// eslint-disable-next-line no-undef
if (state.VERSION !== VERSION) {
if (state.VERSION && state.VERSION !== VERSION) {
const errorText =
'New version of Chronograf detected. Local settings cleared.'
@ -18,7 +18,7 @@ export const loadLocalStorage = errorsQueue => {
delete state.VERSION
return state || {}
return state
} catch (error) {
const errorText = `Loading local settings failed: ${error}`