diff --git a/ngsw-config.json b/ngsw-config.json index eefe9b9..9f2ec7a 100644 --- a/ngsw-config.json +++ b/ngsw-config.json @@ -1,9 +1,9 @@ { "$schema": "./node_modules/@angular/service-worker/config/schema.json", "appData": { - "appVersion": "0.0.22", - "buildDate": "2026-05-16T16:59:05.769Z", - "buildNumber": 22 + "appVersion": "0.0.23", + "buildDate": "2026-05-16T17:49:14.877Z", + "buildNumber": 23 }, "assetGroups": [ { diff --git a/src/app/domains/pos/layouts/mainMenuSidebar/main-menu-sidebar.component.ts b/src/app/domains/pos/layouts/mainMenuSidebar/main-menu-sidebar.component.ts index e7e334e..a4637b9 100644 --- a/src/app/domains/pos/layouts/mainMenuSidebar/main-menu-sidebar.component.ts +++ b/src/app/domains/pos/layouts/mainMenuSidebar/main-menu-sidebar.component.ts @@ -2,11 +2,9 @@ import { ToastService } from '@/core/services/toast.service'; import { AbstractDialog } from '@/shared/abstractClasses/abstract-dialog'; import { Component, computed, inject } from '@angular/core'; import { RouterLink } from '@angular/router'; -import { SwUpdate, VersionReadyEvent } from '@angular/service-worker'; import { Button } from 'primeng/button'; import { Drawer } from 'primeng/drawer'; import { Ripple } from 'primeng/ripple'; -import { filter } from 'rxjs'; import config from 'src/config'; import { posAboutNamedRoutes } from '../../modules/about/constants'; import { posConfigNamedRoutes } from '../../modules/configs/constants'; @@ -21,7 +19,7 @@ import { PosInfoStore } from '../../store'; }) export class PosMainMenuSidebarComponent extends AbstractDialog { private readonly posInfoStore = inject(PosInfoStore); - private readonly swUpdate = inject(SwUpdate); + // private readonly swUpdate = inject(SwUpdate); private readonly toastService = inject(ToastService); readonly posInfo = computed(() => this.posInfoStore.entity()); @@ -65,7 +63,7 @@ export class PosMainMenuSidebarComponent extends AbstractDialog { ]; ngOnInit() { - this.isPwaBuild = this.swUpdate.isEnabled; + // this.isPwaBuild = this.swUpdate.isEnabled; if (!this.isPwaBuild) return; @@ -79,13 +77,13 @@ export class PosMainMenuSidebarComponent extends AbstractDialog { console.log('err', err); }); - this.swUpdate.versionUpdates - .pipe(filter((event): event is VersionReadyEvent => event.type === 'VERSION_READY')) - .subscribe((event) => { - const appData = event.latestVersion.appData as { appVersion?: string } | undefined; - this.appVersion = appData?.appVersion || this.appVersion; - }); + // this.swUpdate.versionUpdates + // .pipe(filter((event): event is VersionReadyEvent => event.type === 'VERSION_READY')) + // .subscribe((event) => { + // const appData = event.latestVersion.appData as { appVersion?: string } | undefined; + // this.appVersion = appData?.appVersion || this.appVersion; + // }); - this.swUpdate.checkForUpdate().catch(() => {}); + // this.swUpdate.checkForUpdate().catch(() => {}); } } diff --git a/src/app/domains/pos/modules/about/views/root.component.html b/src/app/domains/pos/modules/about/views/root.component.html index c762010..212d150 100644 --- a/src/app/domains/pos/modules/about/views/root.component.html +++ b/src/app/domains/pos/modules/about/views/root.component.html @@ -34,7 +34,7 @@ -
+

diff --git a/src/app/domains/pos/modules/about/views/root.component.ts b/src/app/domains/pos/modules/about/views/root.component.ts index 4ed7b37..7ea7bec 100644 --- a/src/app/domains/pos/modules/about/views/root.component.ts +++ b/src/app/domains/pos/modules/about/views/root.component.ts @@ -1,8 +1,6 @@ import { brandingConfig } from '@/branding/branding.config'; -import { Component, computed, inject, signal } from '@angular/core'; -import { SwUpdate, VersionReadyEvent } from '@angular/service-worker'; +import { Component, computed, signal } from '@angular/core'; import { ButtonDirective } from 'primeng/button'; -import { filter } from 'rxjs'; @Component({ selector: 'pos-about-page', @@ -10,17 +8,17 @@ import { filter } from 'rxjs'; imports: [ButtonDirective], }) export class PosAboutPageComponent { - private readonly swUpdate = inject(SwUpdate); + // private readonly swUpdate = inject(SwUpdate); brandingInfo = brandingConfig; appVersion = signal('0.0.0'); - isPwaBuild = this.swUpdate.isEnabled; + // isPwaBuild = this.swUpdate.isEnabled; isCheckingUpdate = signal(false); hasUpdate = signal(false); isUpdated = signal(false); updateCtaLabel = computed(() => { - if (!this.isPwaBuild) return 'به روزرسانی فقط در نسخه PWA'; + // if (!this.isPwaBuild) return 'به روزرسانی فقط در نسخه PWA'; if (this.isUpdated()) return 'به روز است'; if (this.hasUpdate()) return 'به روزرسانی برنامه'; if (this.isCheckingUpdate()) return 'در حال بررسی...'; @@ -28,21 +26,21 @@ export class PosAboutPageComponent { }); ngOnInit() { - if (!this.isPwaBuild) return; + // if (!this.isPwaBuild) return; this.loadVersion(); - this.swUpdate.versionUpdates - .pipe(filter((event): event is VersionReadyEvent => event.type === 'VERSION_READY')) - .subscribe((event) => { - const appData = event.latestVersion.appData as { appVersion?: string } | undefined; - this.appVersion.set(appData?.appVersion || this.appVersion()); - this.hasUpdate.set(true); - this.isUpdated.set(false); - }); + // this.swUpdate.versionUpdates + // .pipe(filter((event): event is VersionReadyEvent => event.type === 'VERSION_READY')) + // .subscribe((event) => { + // const appData = event.latestVersion.appData as { appVersion?: string } | undefined; + // this.appVersion.set(appData?.appVersion || this.appVersion()); + // this.hasUpdate.set(true); + // this.isUpdated.set(false); + // }); } async onUpdateCtaClick() { - if (!this.isPwaBuild || this.isCheckingUpdate()) return; + // if (!this.isPwaBuild || this.isCheckingUpdate()) return; if (this.hasUpdate()) { await this.applyUpdate(); @@ -56,9 +54,9 @@ export class PosAboutPageComponent { this.isCheckingUpdate.set(true); this.isUpdated.set(false); try { - const hasUpdate = await this.swUpdate.checkForUpdate(); - this.hasUpdate.set(hasUpdate); - this.isUpdated.set(!hasUpdate); + // const hasUpdate = await this.swUpdate.checkForUpdate(); + // this.hasUpdate.set(hasUpdate); + // this.isUpdated.set(!hasUpdate); } finally { this.isCheckingUpdate.set(false); } @@ -67,7 +65,7 @@ export class PosAboutPageComponent { private async applyUpdate() { this.isCheckingUpdate.set(true); try { - await this.swUpdate.activateUpdate(); + // await this.swUpdate.activateUpdate(); this.isUpdated.set(true); this.hasUpdate.set(false); window.location.reload(); diff --git a/src/app/domains/pos/modules/landing/components/grid-view.component.html b/src/app/domains/pos/modules/landing/components/grid-view.component.html index 63a07ce..69516e0 100644 --- a/src/app/domains/pos/modules/landing/components/grid-view.component.html +++ b/src/app/domains/pos/modules/landing/components/grid-view.component.html @@ -7,21 +7,21 @@ } } @else { @for (good of visibleGoods(); track good.id) { -

+
-
- +
+ {{ good.name }} @if (!good.is_default_guild_good) { * } -
+