From 244ede09cbb6698b28dfaeda889a87a880f9f0f3 Mon Sep 17 00:00:00 2001 From: Roman Sedov Date: Tue, 23 Mar 2021 10:37:45 +0300 Subject: [PATCH] feat(page-visibility): document.hidden -> document.visibilityState (#18) --- projects/common/src/tokens/page-visibility.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/common/src/tokens/page-visibility.ts b/projects/common/src/tokens/page-visibility.ts index d8a870c35..e1093544b 100644 --- a/projects/common/src/tokens/page-visibility.ts +++ b/projects/common/src/tokens/page-visibility.ts @@ -11,7 +11,7 @@ export const PAGE_VISIBILITY = new InjectionToken>( return fromEvent(documentRef, 'visibilitychange').pipe( startWith(0), - map(() => !documentRef.hidden), + map(() => documentRef.visibilityState !== 'hidden'), distinctUntilChanged(), share(), );