fix:Fix the bug in server-side rendering where navigator is not available

This commit is contained in:
david_bai
2025-08-24 08:15:01 +08:00
parent 94c9ba7ad3
commit a1a70bbff5
+4 -1
View File
@@ -6,7 +6,10 @@ export class WakeLockManager {
constructor() {
// Check if the browser supports the Wake Lock API
this.isSupported = "wakeLock" in navigator;
this.isSupported =
typeof window !== "undefined" &&
typeof navigator !== "undefined" &&
"wakeLock" in navigator;
}
async requestWakeLock(): Promise<void> {