mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-14 21:32:41 +00:00
Remove setting button styles in componentDidMount
Just set the state, and the renderer will know what to display.
This commit is contained in:
@@ -44,21 +44,9 @@ const SplitPane = createClass({
|
|||||||
}
|
}
|
||||||
window.addEventListener('resize', this.handleWindowResize);
|
window.addEventListener('resize', this.handleWindowResize);
|
||||||
|
|
||||||
|
|
||||||
// This lives here instead of in the initial render because you cannot touch localStorage until the componant mounts.
|
// This lives here instead of in the initial render because you cannot touch localStorage until the componant mounts.
|
||||||
const loadLiveScroll = window.localStorage.getItem('liveScroll') === 'true';
|
const loadLiveScroll = window.localStorage.getItem('liveScroll') === 'true';
|
||||||
this.setState({
|
this.setState({ liveScroll : loadLiveScroll });
|
||||||
liveScroll : loadLiveScroll
|
|
||||||
});
|
|
||||||
const toggle = document.getElementById('scrollToggle');
|
|
||||||
const toggleDiv = document.getElementById('scrollToggleDiv');
|
|
||||||
if(loadLiveScroll) {
|
|
||||||
toggle.className = 'fas fa-lock';
|
|
||||||
toggleDiv.className = 'arrow lock';
|
|
||||||
} else {
|
|
||||||
toggle.className = 'fas fa-unlock';
|
|
||||||
toggleDiv.className = 'arrow unlock';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillUnmount : function() {
|
componentWillUnmount : function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user