feat: update PWA installation logic, enhance app versioning, and streamline environment configurations
This commit is contained in:
@@ -20,9 +20,6 @@ export class PwaInstallService {
|
||||
window.matchMedia('(display-mode: standalone)').matches ||
|
||||
(window.navigator as any).standalone === true;
|
||||
|
||||
console.log(window.matchMedia('(display-mode: standalone)').matches);
|
||||
console.log(window.navigator);
|
||||
|
||||
this.isInstalled.set(standalone);
|
||||
|
||||
window.addEventListener('beforeinstallprompt', (event: any) => {
|
||||
@@ -30,7 +27,6 @@ export class PwaInstallService {
|
||||
|
||||
this.deferredInstallPrompt = event;
|
||||
this.canInstall.set(true);
|
||||
console.log(this.deferredInstallPrompt);
|
||||
});
|
||||
|
||||
window.addEventListener('appinstalled', () => {
|
||||
@@ -45,8 +41,6 @@ export class PwaInstallService {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('openInstallConfirm');
|
||||
|
||||
this.confirmationService.confirm({
|
||||
header: 'نصب اپلیکیشن',
|
||||
message: 'برای ادامه میبایست نیازمندیهای نرمافزار را نصب کنید',
|
||||
@@ -59,6 +53,7 @@ export class PwaInstallService {
|
||||
this.deferredInstallPrompt.userChoice.finally(() => {
|
||||
this.deferredInstallPrompt = null;
|
||||
this.canInstall.set(false);
|
||||
window.location.reload();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user