We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43b678f commit f1fededCopy full SHA for f1feded
src/lib/queries/client/focusManager.ts
@@ -1,5 +1,3 @@
1
-"use client"
2
-
3
import {
4
filter,
5
fromEvent,
@@ -14,12 +12,12 @@ import { isServer } from "../../utils"
14
12
15
13
export class FocusManager {
16
readonly #visibility$ = merge(
17
- fromEvent(document, "visibilitychange"),
+ isServer ? EMPTY : fromEvent(document, "visibilitychange"),
18
isServer ? EMPTY : fromEvent(window, "visibilitychange")
19
).pipe(map(() => document.visibilityState))
20
21
readonly #focusedSubject = new BehaviorSubject(
22
- document.visibilityState === "visible"
+ isServer ? true : document.visibilityState === "visible"
23
)
24
25
// public readonly focused$ = this.#focusedSubject.pipe(distinctUntilChanged())
0 commit comments