update route

This commit is contained in:
2026-10-05 15:54:30 +03:00
parent a18f6da573
commit 628b993041
5 changed files with 21 additions and 14 deletions
+2 -4
View File
@@ -28,9 +28,7 @@ export class CityPage {
protected readonly collectedIds = this.store.selectSignal(selectCollectedIdSet);
protected readonly openedCount = this.store.selectSignal(selectOpenedCount);
protected readonly progress = this.store.selectSignal(selectProgress);
protected readonly closedCount = computed(
() => this.city.objects.length - this.openedCount(),
);
protected readonly closedCount = computed(() => this.city.objects.length - this.openedCount());
protected readonly landmarks = computed(() => {
const items = this.city.objects;
const ids = this.collectedIds();
@@ -70,6 +68,6 @@ export class CityPage {
}
protected objectRoute(id: string): string[] {
return this.collectedIds().has(id) ? ['/items', id, 'icon'] : ['/items', id];
return this.collectedIds().has(id) ? ['/city', id, 'icon'] : ['/city', id];
}
}
@@ -1,4 +1,10 @@
import { afterNextRender, ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';
import {
afterNextRender,
ChangeDetectionStrategy,
Component,
computed,
inject,
} from '@angular/core';
import { RouterLink } from '@angular/router';
import { Store } from '@ngrx/store';
@@ -6,7 +12,12 @@ import { AuthPromptService } from '../../auth/auth-prompt.service';
import { AuthService } from '../../auth/auth.service';
import { CityCatalogService } from '../../root/services/city-catalog.service';
import { Icon } from '../../shared/icon/icon';
import { selectCollectedIdSet, selectOpenedCount, selectProfile, selectProgress } from '../../state';
import {
selectCollectedIdSet,
selectOpenedCount,
selectProfile,
selectProgress,
} from '../../state';
@Component({
selector: 'app-collections-page',
@@ -45,7 +56,7 @@ export class CollectionsPage {
);
protected objectRoute(id: string): string[] {
return this.collectedIds().has(id) ? ['/items', id, 'icon'] : ['/items', id];
return this.collectedIds().has(id) ? ['/city', id, 'icon'] : ['/city', id];
}
protected logout(): void {
@@ -35,7 +35,7 @@ export class IconPreviewPage {
return;
}
void this.router.navigate(['/items', item.id], { replaceUrl: true });
void this.router.navigate(['/city', item.id], { replaceUrl: true });
});
}
}