fix: enable web runtime notifications without push (#1322)

Web notifications now listen to the notification stream directly
Native notifications no longer depend on PWA push being enabled
Window focus is respected when deciding whether to send background push notifications
This commit is contained in:
Bohdan Triapitsyn
2026-05-19 13:16:47 +03:00
parent f40110698f
commit 87d13cf61b
4 changed files with 65 additions and 2 deletions
@@ -6,8 +6,7 @@ const HEARTBEAT_MS = 20000;
const resolveVisibilityState = (): 'visible' | 'hidden' => {
if (typeof document === 'undefined') return 'visible';
const state = document.visibilityState;
return state === 'hidden' && document.hasFocus() ? 'visible' : state;
return document.visibilityState === 'visible' && document.hasFocus() ? 'visible' : 'hidden';
};
const sendVisibility = (visible: boolean) => {