Skip to content

Commit

Permalink
add takeuntildestryed
Browse files Browse the repository at this point in the history
  • Loading branch information
HarelM committed Jun 13, 2024
1 parent 55dd818 commit 492ceb8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from "@angular/core";
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
import { MatDialog } from "@angular/material/dialog";
import { remove } from "lodash-es";
import { Angulartics2GoogleGlobalSiteTag } from "angulartics2";
Expand All @@ -12,7 +13,7 @@ import { ResourcesService } from "../../services/resources.service";
import { LayersService } from "../../services/layers.service";
import { RunningContextService } from "../../services/running-context.service";
import { ISRAEL_MTB_MAP, ISRAEL_HIKING_MAP } from "../../reducers/initial-state";
import type { ApplicationState, Language } from "../../models/models";
import type { ApplicationState } from "../../models/models";
import legendSectionsJson from "../../../content/legend/legend.json";

export type LegendSection = {
Expand Down Expand Up @@ -44,7 +45,7 @@ export class InfoSidebarComponent extends BaseMapComponent {
this.selectedSection = null;
this.legendSections = [];

this.store.select((state: ApplicationState) => state.configuration.language).subscribe(() => {
this.store.select((state: ApplicationState) => state.configuration.language).pipe(takeUntilDestroyed()).subscribe(() => {
this.initalizeLegendSections();
});
}
Expand Down

0 comments on commit 492ceb8

Please sign in to comment.