Skip to content

Commit

Permalink
fix: reset filters on geolocate (#318)
Browse files Browse the repository at this point in the history
* fix: reset filters on geolocate

* fix: naming function of reseting query params on geolocate
  • Loading branch information
abelkhay committed Jul 18, 2023
1 parent 3816400 commit 6e3322e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ <h3 class="card-title text-primary">
</div>
<div class="col overflow-auto position-relative">
<div class="p-3 position-absolute start-0 z-index-over-base d-md-block d-none" *ngIf="(loadingState$ | async) === false">
<app-user-location [adresse]="(defaultAddress$ | async) ?? ''" (location)="userLocalisation = $event"></app-user-location>
<app-user-location
[adresse]="(defaultAddress$ | async) ?? ''"
(location)="resetBreadcrumbOnGeolocate($event)"></app-user-location>
</div>
<mgl-map
[movingMethod]="'flyTo'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,13 @@ export class CartographieLayout {
private getRouteParam(routeParam: string) {
return this.route.children[0]?.children[0]?.snapshot.paramMap.get(routeParam) ?? '';
}

public resetBreadcrumbOnGeolocate(localisation: Localisation): Localisation {
if (localisation)
this.router.navigate(['/cartographie'], {
queryParams: {},
queryParamsHandling: 'merge'
});
return (this.userLocalisation = localisation);
}
}

0 comments on commit 6e3322e

Please sign in to comment.