Skip to content

Commit

Permalink
update type
Browse files Browse the repository at this point in the history
  • Loading branch information
ntqdinh-axonivy committed Dec 17, 2024
1 parent 9b9c237 commit 76fa3b5
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { computed, Injectable, signal } from '@angular/core';
import { computed, Injectable, Signal, signal } from '@angular/core';
import { DESIGNER_SESSION_STORAGE_VARIABLE } from '../constants/common.constant';
import { Router, Params, NavigationStart } from '@angular/router';
import { Observable } from 'rxjs';
Expand All @@ -11,9 +11,7 @@ export class RoutingQueryParamService {
isDesignerEnv = computed(() => this.isDesigner());
designerVersion = signal('');

constructor(
private readonly router: Router
) {
constructor(private readonly router: Router) {
this.getNavigationStartEvent().subscribe(() => {
if (!this.isDesigner()) {
this.isDesigner.set(
Expand All @@ -25,7 +23,7 @@ export class RoutingQueryParamService {
});
}

checkSessionStorageForDesignerVersion(params: Params) {
checkSessionStorageForDesignerVersion(params: Params): void {
const versionParam =
params[DESIGNER_SESSION_STORAGE_VARIABLE.ivyVersionParamName];
if (versionParam !== undefined) {
Expand All @@ -37,7 +35,7 @@ export class RoutingQueryParamService {
}
}

checkSessionStorageForDesignerEnv(params: Params) {
checkSessionStorageForDesignerEnv(params: Params): void {
const ivyViewerParam =
params[DESIGNER_SESSION_STORAGE_VARIABLE.ivyViewerParamName];
if (
Expand All @@ -51,7 +49,7 @@ export class RoutingQueryParamService {
}
}

getDesignerVersionFromSessionStorage() {
getDesignerVersionFromSessionStorage(): string {
if (this.designerVersion() === '') {
this.designerVersion.set(
sessionStorage.getItem(
Expand All @@ -62,7 +60,7 @@ export class RoutingQueryParamService {
return this.designerVersion();
}

isDesignerViewer() {
isDesignerViewer(): boolean {
if (!this.isDesigner()) {
this.isDesigner.set(
sessionStorage.getItem(
Expand All @@ -73,9 +71,9 @@ export class RoutingQueryParamService {
return this.isDesigner();
}

getNavigationStartEvent(): Observable<NavigationStart> {
getNavigationStartEvent() {
return this.router.events.pipe(
filter(event => event instanceof NavigationStart)
);
) as Observable<NavigationStart>;
}
}

0 comments on commit 76fa3b5

Please sign in to comment.