[Glitch] Fix crash in old browsers

Port fb35c11084 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
lolsob-rspec
Claire 2021-04-01 00:00:12 +02:00
parent ba9921c644
commit d5f59d7155
1 changed files with 10 additions and 2 deletions

View File

@ -90,7 +90,11 @@ class ColumnsArea extends ImmutablePureComponent {
}
if (this.mediaQuery) {
if (this.mediaQuery.addEventListener) {
this.mediaQuery.addEventListener('change', this.handleLayoutChange);
} else {
this.mediaQuery.addListener(this.handleLayoutChange);
}
this.setState({ renderComposePanel: !this.mediaQuery.matches });
}
@ -125,7 +129,11 @@ class ColumnsArea extends ImmutablePureComponent {
}
if (this.mediaQuery) {
if (this.mediaQuery.removeEventListener) {
this.mediaQuery.removeEventListener('change', this.handleLayoutChange);
} else {
this.mediaQuery.removeListener(this.handleLayouteChange);
}
}
}