Try to fix screen resolution issue

This commit is contained in:
Scott E. Graves
2019-04-08 23:07:08 -05:00
parent 9ad2f798da
commit 177fd97c4b

View File

@@ -7,8 +7,13 @@ export default CSSModules(class extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
window.addEventListener("resize", this.updateSizeAsync); window.addEventListener("resize", this.updateSizeAsync);
this.checkSizeInterval = setInterval(()=> {
this.updateSize()
}, 2000);
} }
checkSizeInterval;
state = { state = {
calculated: false, calculated: false,
dimensions: { dimensions: {
@@ -59,6 +64,7 @@ export default CSSModules(class extends Component {
componentWillUnmount = () => { componentWillUnmount = () => {
window.removeEventListener("resize", this.updateSizeAsync); window.removeEventListener("resize", this.updateSizeAsync);
clearInterval(this.checkSizeInterval);
}; };
render() { render() {