Merge pull request #2892 from Eugeny/fixed-dpr-listener

fixed ScreenDprListener never being fired
This commit is contained in:
Daniel Imms
2020-05-02 15:54:52 -07:00
committed by GitHub
+2 -2
View File
@@ -44,12 +44,12 @@ export class ScreenDprMonitor extends Disposable {
}
private _updateDpr(): void {
if (!this._resolutionMediaMatchList || !this._outerListener) {
if (!this._outerListener) {
return;
}
// Clear listeners for old DPR
this._resolutionMediaMatchList.removeListener(this._outerListener);
this._resolutionMediaMatchList?.removeListener(this._outerListener);
// Add listeners for new DPR
this._currentDevicePixelRatio = window.devicePixelRatio;