Fix: fix improved close behavior with production minified javascript

This commit is contained in:
shamoon
2025-03-08 19:17:08 -08:00
parent b746b6f2d6
commit 955ff32dcd
3 changed files with 38 additions and 12 deletions

View File

@@ -29,7 +29,7 @@ describe('ComponentRouterService', () => {
eventsSubject.next(
new ActivationStart({
url: 'test-url',
component: { name: 'TestComponent' },
data: { componentName: 'TestComponent' },
} as any)
)
@@ -41,13 +41,13 @@ describe('ComponentRouterService', () => {
eventsSubject.next(
new ActivationStart({
url: 'test-url-1',
component: { name: 'TestComponent' },
data: { componentName: 'TestComponent' },
} as any)
)
eventsSubject.next(
new ActivationStart({
url: 'test-url-2',
component: { name: 'TestComponent' },
data: { componentName: 'TestComponent' },
} as any)
)
@@ -59,13 +59,13 @@ describe('ComponentRouterService', () => {
eventsSubject.next(
new ActivationStart({
url: 'test-url-1',
component: { name: 'TestComponent1' },
data: { componentName: 'TestComponent1' },
} as any)
)
eventsSubject.next(
new ActivationStart({
url: 'test-url-2',
component: { name: 'TestComponent2' },
data: { componentName: 'TestComponent2' },
} as any)
)
@@ -76,13 +76,13 @@ describe('ComponentRouterService', () => {
eventsSubject.next(
new ActivationStart({
url: 'test-url-1',
component: { name: 'TestComponent' },
data: { componentName: 'TestComponent' },
} as any)
)
eventsSubject.next(
new ActivationStart({
url: 'test-url-2',
component: { name: 'TestComponent' },
data: { componentName: 'TestComponent' },
} as any)
)
@@ -93,7 +93,7 @@ describe('ComponentRouterService', () => {
eventsSubject.next(
new ActivationStart({
url: 'test-url',
component: { name: 'TestComponent' },
data: { componentName: 'TestComponent' },
} as any)
)

View File

@@ -17,11 +17,11 @@ export class ComponentRouterService {
.subscribe((event: ActivationStart) => {
if (
this.componentHistory[this.componentHistory.length - 1] !==
event.snapshot.component.name &&
!EXCLUDE_COMPONENTS.includes(event.snapshot.component.name)
event.snapshot.data.componentName &&
!EXCLUDE_COMPONENTS.includes(event.snapshot.data.componentName)
) {
this.history.push(event.snapshot.url.toString())
this.componentHistory.push(event.snapshot.component.name)
this.componentHistory.push(event.snapshot.data.componentName)
} else {
// Update the URL of the current component in case the same component was loaded via a different URL
this.history[this.history.length - 1] = event.snapshot.url.toString()