Skip to content

Commit

Permalink
Fix window reference
Browse files Browse the repository at this point in the history
  • Loading branch information
RaananW committed Aug 23, 2021
1 parent 9574b5a commit 4533d22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Misc/computePressure.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { DomManagement } from "./domManagement";

/**
* A wrapper for the experimental compute pressure api which allows a callback to be called whenever certain thresholds are met.
*/
Expand All @@ -18,7 +20,7 @@ export class ComputePressureObserverWrapper {
* Returns true if ComputePressureObserver is available for use, false otherwise.
*/
public static get IsAvailable() {
return 'ComputePressureObserver' in window;
return DomManagement.IsWindowObjectExist() && 'ComputePressureObserver' in window;
}

/**
Expand Down

0 comments on commit 4533d22

Please sign in to comment.