feat: update PWA installation logic, enhance app versioning, and streamline environment configurations

This commit is contained in:
2026-05-11 20:26:02 +03:30
parent ff9bbad336
commit d513ea381e
8 changed files with 9 additions and 17 deletions
+1 -6
View File
@@ -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');
+1 -1
View File
@@ -1,7 +1,7 @@
// Development environment configuration
export const environment = {
production: false,
apiBaseUrl: 'https://psp-api.shift-am.ir:5002',
apiBaseUrl: 'https://psp-api.shift-am.ir',
// apiBaseUrl: 'http://192.168.128.73:5002',
host: 'localhost',
port: 5001,
+1 -1
View File
@@ -1,7 +1,7 @@
// TIS tenant environment configuration
export const environment = {
production: true,
apiBaseUrl: 'https://psp-api.shift-am.ir:5002',
apiBaseUrl: 'https://psp-api.shift-am.ir',
// apiBaseUrl: 'http://192.168.128.73:5002',
host: 'localhost',
port: 5000,