Skip to content

Commit

Permalink
Reuse remotedev-app/lib/utils/localStorage on DevToolsDock
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Aug 4, 2016
1 parent 2bd8023 commit 0d7a762
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import React, { Component, PropTypes } from 'react';
import {
getFromStorage, saveToStorage,
} from 'remotedev-app/lib/utils/localStorage';
import { render } from 'react-dom';
import Dock from 'react-dock';
import DevTools from './DevTools';
Expand All @@ -22,7 +25,7 @@ class DevToolsDock extends Component {
handleSizeChange = eventSize => {
let size = eventSize > 1 ? 1 : eventSize;
size = size < 0.1 ? 0.1 : size;
localStorage.setItem(dockSizeKey, size);
saveToStorage(dockSizeKey, size);
this.setState({ size });
};

Expand All @@ -44,7 +47,7 @@ class DevToolsDock extends Component {

render(
<DevToolsDock
size={Number(localStorage.getItem(dockSizeKey))}
size={Number(getFromStorage(dockSizeKey))}
options={window.remotedevOptions}
/>,
document.getElementById('remote-redux-devtools-on-debugger')
Expand Down

0 comments on commit 0d7a762

Please sign in to comment.