From 4df4baf1b06c49cd8fc90751d71925525e1bbf64 Mon Sep 17 00:00:00 2001 From: Yury Shapkarin Date: Sat, 1 Feb 2020 00:02:00 +0300 Subject: [PATCH] fix dense option --- package-lock.json | 2 +- src/options/components/options.jsx | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0ef7d43..c2104c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tab-glutton", - "version": "2.2.0", + "version": "2.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/options/components/options.jsx b/src/options/components/options.jsx index 2936304..a5ed704 100644 --- a/src/options/components/options.jsx +++ b/src/options/components/options.jsx @@ -5,10 +5,15 @@ import themes, { DEFAULT_THEME } from '../../themes'; export default class Options extends React.Component { constructor(props) { super(props); + const localStorage = { + showURL: window.localStorage.getItem('showURL'), + isCollapsed: window.localStorage.getItem('isCollapsed'), + isSeparated: window.localStorage.getItem('isSeparated'), + } this.state = { - showUrl: window.localStorage.getItem('showURL') === 'true', - isSeparated: window.localStorage.getItem('isSeparated') === 'true', - isCollapsed: window.localStorage.getItem('isCollapsed') === 'true', + showUrl: JSON.parse(localStorage.showURL), + isSeparated: JSON.parse(localStorage.isSeparated), + isCollapsed: localStorage.isCollapsed === null ? true : JSON.parse(localStorage.isCollapsed), theme: window.localStorage.getItem('theme') || DEFAULT_THEME }; this.changeTheme = this.changeTheme.bind(this);