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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user