Style changes

This commit is contained in:
binwiederhier 2023-06-25 21:10:25 -04:00
parent dbd8ed14bf
commit 94fb23ba17
3 changed files with 8 additions and 7 deletions

View file

@ -136,9 +136,12 @@ export const useAutoSubscribe = (subscriptions, selected) => {
}, [params, subscriptions, selected, hasRun]);
};
/**
* Watches the "display-mode" to detect if the app is running as a standalone app (PWA),
* and enables "Web Push" if it is.
*/
export const useStandaloneAutoWebPushSubscribe = () => {
const matchMedia = window.matchMedia("(display-mode: standalone)");
const [isStandalone, setIsStandalone] = useState(isLaunchedPWA());
useEffect(() => {
@ -157,7 +160,7 @@ export const useStandaloneAutoWebPushSubscribe = () => {
useEffect(() => {
if (isStandalone) {
console.log(`[useStandaloneAutoWebPushSubscribe] Turning on web push automatically`);
prefs.setWebPushEnabled(true);
prefs.setWebPushEnabled(true); // Dangle!
}
}, [isStandalone]);
};