update
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
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';
|
||||
@@ -16,6 +17,7 @@ import { PosInfoStore } from '../../store';
|
||||
export class PosMainMenuSidebarComponent extends AbstractDialog {
|
||||
private readonly posInfoStore = inject(PosInfoStore);
|
||||
private readonly swUpdate = inject(SwUpdate);
|
||||
private readonly toastService = inject(ToastService);
|
||||
|
||||
readonly posInfo = computed(() => this.posInfoStore.entity());
|
||||
appVersion = '0.0.0';
|
||||
@@ -31,12 +33,15 @@ export class PosMainMenuSidebarComponent extends AbstractDialog {
|
||||
|
||||
ngOnInit() {
|
||||
this.isPwaBuild = this.swUpdate.isEnabled;
|
||||
console.log(this.swUpdate);
|
||||
|
||||
if (!this.isPwaBuild) return;
|
||||
|
||||
fetch('/ngsw.json')
|
||||
.then((res) => res.json())
|
||||
.then((data: { appData?: { appVersion?: string } }) => {
|
||||
this.appVersion = data?.appData?.appVersion || this.appVersion;
|
||||
this.toastService.info({ text: this.appVersion });
|
||||
console.log('appVersion:', data?.appData);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user