Also listen to window updates to handle zooming

This commit is contained in:
Torjus
2018-07-17 11:47:08 +02:00
parent 3cb77188be
commit a877eb6eb6
+6
View File
@@ -56,11 +56,17 @@ class Peers extends React.Component
componentDidMount()
{
window.addEventListener('resize', this.updateDimensions);
const observer = new ResizeObserver(this.updateDimensions);
observer.observe(this.refs.peers);
}
componentWillUnmount()
{
window.removeEventListener('resize', this.updateDimensions);
}
componentDidUpdate()
{
this.updateDimensions();