remove unused codes and update
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { AuthService } from '@/core';
|
||||
import { NativeBridgeService } from '@/core/services';
|
||||
import { ToastService } from '@/core/services/toast.service';
|
||||
import { LayoutService } from '@/layout/service/layout.service';
|
||||
import { PageLoadingComponent } from '@/shared/components/page-loading.component';
|
||||
import { CommonModule } from '@angular/common';
|
||||
@@ -13,13 +11,15 @@ import {
|
||||
inject,
|
||||
signal,
|
||||
} from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { RouterLinkWithHref, RouterOutlet } from '@angular/router';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { Button, ButtonDirective } from 'primeng/button';
|
||||
import { Card } from 'primeng/card';
|
||||
import { Menu } from 'primeng/menu';
|
||||
import { finalize } from 'rxjs';
|
||||
import images from 'src/assets/images';
|
||||
import { PosInfoStore, PosProfileStore } from '../store';
|
||||
import { DeviceInfoStore } from '../store/device.store';
|
||||
import { PosChooseCardsComponent } from './choose-pos.component';
|
||||
import { PosMainMenuSidebarComponent } from './mainMenuSidebar/main-menu-sidebar.component';
|
||||
|
||||
@@ -36,13 +36,14 @@ import { PosMainMenuSidebarComponent } from './mainMenuSidebar/main-menu-sidebar
|
||||
PosMainMenuSidebarComponent,
|
||||
Menu,
|
||||
CommonModule,
|
||||
RouterLinkWithHref,
|
||||
],
|
||||
})
|
||||
export class PosLayoutComponent implements AfterViewInit {
|
||||
constructor() {}
|
||||
|
||||
private readonly nativeBridgeService = inject(NativeBridgeService);
|
||||
private readonly toastService = inject(ToastService);
|
||||
// private readonly nativeBridgeService = inject(NativeBridgeService);
|
||||
// private readonly toastService = inject(ToastService);
|
||||
|
||||
@ViewChild('topbarStart', { static: true }) topbarStart!: TemplateRef<any>;
|
||||
@ViewChild('topbarCenter', { static: true }) topbarCenter!: TemplateRef<any>;
|
||||
@@ -50,6 +51,7 @@ export class PosLayoutComponent implements AfterViewInit {
|
||||
|
||||
private readonly posProfileStore = inject(PosProfileStore);
|
||||
private readonly posInfoStore = inject(PosInfoStore);
|
||||
private readonly deviceInfoStore = inject(DeviceInfoStore);
|
||||
private readonly authService = inject(AuthService);
|
||||
private readonly layoutService = inject(LayoutService);
|
||||
|
||||
@@ -66,6 +68,8 @@ export class PosLayoutComponent implements AfterViewInit {
|
||||
readonly loading = computed(() => this.posProfileLoading());
|
||||
readonly error = computed(() => this.posProfileError());
|
||||
|
||||
readonly deviceInfo = computed(() => this.deviceInfoStore.entity());
|
||||
|
||||
logout = () => {
|
||||
this.authService.logout();
|
||||
};
|
||||
@@ -91,10 +95,21 @@ export class PosLayoutComponent implements AfterViewInit {
|
||||
pullDistance = signal(0);
|
||||
readonly pullThreshold = 80;
|
||||
|
||||
getData() {
|
||||
this.posProfileStore.getData().subscribe({
|
||||
homeRouteLink = '/pos';
|
||||
|
||||
async getData() {
|
||||
await this.layoutService.changeFullPageLoading(true);
|
||||
await this.deviceInfoStore.getData();
|
||||
await this.posProfileStore.getData().subscribe({
|
||||
next: () => {
|
||||
this.posInfoStore.getData().subscribe();
|
||||
this.posInfoStore
|
||||
.getData()
|
||||
.pipe(
|
||||
finalize(() => {
|
||||
this.layoutService.changeFullPageLoading(false);
|
||||
}),
|
||||
)
|
||||
.subscribe();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user