mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-01 17:22:42 +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);
|
||||
|
||||
|
||||
// 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';
|
||||
this.setState({
|
||||
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';
|
||||
}
|
||||
this.setState({ liveScroll : loadLiveScroll });
|
||||
},
|
||||
|
||||
componentWillUnmount : function() {
|
||||
|
||||
Reference in New Issue
Block a user