navigatedEvent is not loading in new site

Copper Contributor

When I switch between sites - Site A (eng) and Site B (polish), the navigation from term store is loading from Site A in Site B. I have called the navigatedEvent to render the navigation when switching between sites but somehow it is not triggering the navigation in Site B (polish). As it shows the navigation from english site for at least sometime.

 

 

@override
  public onInit(): Promise<void> {
    Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);
    super.onInit().then(_ => {
      console.log("super oninit called");
      sp.setup({
        spfxContext: this.context,
        defaultCachingTimeoutSeconds: 30,
        globalCacheDisable: false
      });
    }).then((_) => {
      console.log("Sp Initilize");
      this.context.application.navigatedEvent.add(this, this._renderPlaceHolders);
    });

    return Promise.resolve();
  }

 private _renderPlaceHolders(): void {
    console.log("NavigationApplicationCustomizer._renderPlaceHolders()");
    console.log(
      "Available placeholders: ",
      this.context.placeholderProvider.placeholderNames
        .map(name => PlaceholderName[name])
        .join(", ")
    );

 

0 Replies