0
0
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:
Trevor Buckner
2024-09-09 23:39:29 -04:00
parent 0fbb4879a9
commit 315296458a

View File

@@ -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() {