changed logic in pwa install
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Failing after 2m33s
Laravel Larastan / larastan (pull_request) Failing after 2m37s

This commit is contained in:
dhanabalan
2026-01-23 15:39:48 +05:30
parent 6a62dce305
commit fce45b5386

View File

@@ -22,36 +22,36 @@ window.addEventListener("beforeinstallprompt", (e) => {
}); });
}); });
/* ----------------------------- // /* -----------------------------
IOS SAFARI MANUAL INSTALL // IOS SAFARI MANUAL INSTALL
------------------------------*/ // ------------------------------*/
function isIosSafari() { // function isIosSafari() {
return ( // return (
/iP(ad|hone|od)/.test(navigator.userAgent) && // /iP(ad|hone|od)/.test(navigator.userAgent) &&
/Safari/.test(navigator.userAgent) && // /Safari/.test(navigator.userAgent) &&
!/CriOS|FxiOS|OPiOS/.test(navigator.userAgent) // !/CriOS|FxiOS|OPiOS/.test(navigator.userAgent)
); // );
} // }
function isInStandaloneMode() { // function isInStandaloneMode() {
return window.navigator.standalone === true; // return window.navigator.standalone == true;
} // }
document.addEventListener("DOMContentLoaded", () => { // document.addEventListener("DOMContentLoaded", () => {
if ( // if (
isIosSafari() && // isIosSafari() &&
!isInStandaloneMode() && // !isInStandaloneMode() &&
!localStorage.getItem("iosInstallShown") // !localStorage.getItem("iosInstallShown")
) { // ) {
showInstallBanner({ // showInstallBanner({
message: '📱 Install <b>Quality</b> App<br><small>Tap Share ⬆️ → Add to Home Screen</small>', // message: '📱 Install <b>Quality</b> App<br><small>Tap Share ⬆️ → Add to Home Screen</small>',
buttonText: 'Got it', // buttonText: 'Got it',
onClick: () => { // onClick: () => {
localStorage.setItem("iosInstallShown", "1"); // localStorage.setItem("iosInstallShown", "1");
} // }
}); // });
} // }
}); // });
/* ----------------------------- /* -----------------------------
COMMON INSTALL BANNER UI COMMON INSTALL BANNER UI