added use pwa composable

This commit is contained in:
Mamalizz
2025-03-18 20:36:09 +03:30
parent 7bc1ff9954
commit 3780eb9860
+19
View File
@@ -0,0 +1,19 @@
export const usePWA = () => {
const isInstalledAsPWA = ref(false);
const checkPWAInstallation = () => {
const isStandalone = window.matchMedia(
"(display-mode: standalone)"
).matches;
const isIOSPWA = (window.navigator as any).standalone;
isInstalledAsPWA.value = isStandalone || isIOSPWA;
};
onMounted(() => {
checkPWAInstallation();
});
return {
isInstalledAsPWA,
};
};