Skip to content

Commit

Permalink
fix: routing back on structure-modal closing (#35)
Browse files Browse the repository at this point in the history
* fix: routing back on structure-modal closing

* fix: switch to navigate back

* fix: code style
  • Loading branch information
hsubtil committed Sep 14, 2022
1 parent c447be3 commit 860c147
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { animate, AUTO_STYLE, state, style, transition, trigger } from '@angular/animations';
import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core';
import { Location } from '@angular/common';
import { ActivatedRoute, Router } from '@angular/router';
import * as _ from 'lodash';
import { Equipment } from '../../../map/models/enum/equipment.enum';
Expand Down Expand Up @@ -68,7 +69,8 @@ export class StructureDetailsComponent implements OnInit {
@Inject(STRUCTURE_TOKEN) readonly structureService: StructureRepository,
private readonly printService: PrintService,
private route: ActivatedRoute,
private router: Router
private router: Router,
private location: Location
) {
route.url.subscribe((url) => {
if (url[0]?.path === 'structure') {
Expand Down Expand Up @@ -158,13 +160,7 @@ export class StructureDetailsComponent implements OnInit {
});
} else {
this.isLoading = true;
this.router.navigate(['./'], {
relativeTo: this.route,
queryParams: {
id: null
},
queryParamsHandling: 'merge'
});
this.location.back();
}
});
}
Expand Down

0 comments on commit 860c147

Please sign in to comment.