mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-07 19:08:37 +03:00
Check to see if screenfull is initialized (#62)
Co-authored-by: Miguel Sozinho Ramalho <19508417+msramalho@users.noreply.github.com>
This commit is contained in:
@@ -15,11 +15,11 @@ export class FullscreenToggle extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
screenfull.on("change", this.onFullscreenStateChange);
|
||||
if (screenfull.on) screenfull.on("change", this.onFullscreenStateChange);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
screenfull.off("change", this.onFullscreenStateChange);
|
||||
if (screenfull.off) screenfull.off("change", this.onFullscreenStateChange);
|
||||
}
|
||||
|
||||
onFullscreenStateChange(evt) {
|
||||
|
||||
Reference in New Issue
Block a user