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();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<div class="h-svh w-svw flex flex-col items-center justify-center">
|
||||
{{ requireInstall }}
|
||||
{{ pwaInstalled() }}
|
||||
{{ canInstall() }}
|
||||
<img [src]="logo" class="w-32 animate-pulse" />
|
||||
@if (requireInstall && !pwaInstalled()) {
|
||||
<div class="mt-6 flex flex-col items-center gap-3">
|
||||
|
||||
@@ -30,7 +30,7 @@ export class PosSplashComponent {
|
||||
constructor() {
|
||||
effect(() => {
|
||||
if (!this.requireInstall || this.pwaInstalled() || this.installPromptShown) {
|
||||
this.getData();
|
||||
// this.getData();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,7 @@
|
||||
<router-outlet></router-outlet>
|
||||
}
|
||||
} @else {
|
||||
@defer (when !isAuth()) {
|
||||
<pos-pages-layout />
|
||||
}
|
||||
<pos-pages-layout />
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -138,8 +138,6 @@ export class AppLayout {
|
||||
this.layoutService.topbarCenterSlot$.subscribe((tpl) => (this.topBarCenterAction = tpl));
|
||||
this.layoutService.topbarEndSlot$.subscribe((tpl) => (this.topBarEndAction = tpl));
|
||||
|
||||
console.log(this.authService.currentAccount());
|
||||
|
||||
if (window.location.pathname === '/') {
|
||||
if (!this.authService.currentAccount()) {
|
||||
this.router.navigateByUrl('auth');
|
||||
|
||||
Reference in New Issue
Block a user