Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/browser/ScreenDprMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ 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);
if (this._resolutionMediaMatchList) {
this._resolutionMediaMatchList.removeListener(this._outerListener);
}

// Add listeners for new DPR
this._currentDevicePixelRatio = window.devicePixelRatio;
Expand Down