Try to fix screen resolution issue
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user