Also listen to window updates to handle zooming

master
Torjus 2018-07-17 11:47:08 +02:00
parent 3cb77188be
commit a877eb6eb6
1 changed files with 6 additions and 0 deletions

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();