haxtheweb / issues

Issue queue for hax, haxcms, elmsln, lrnwebcomponents, wcfactory, websites and more.
Apache License 2.0
11 stars 1 forks source link

haxor-blog issues #2077

Open btopro opened 1 month ago

btopro commented 1 month ago

My guess on editor is the conditional render block is messing with it. The 1st blog post could just be shown on the 1st page and avoid some null route issues but that's not really the point..

btopro commented 1 month ago

related somewhere in here. The route isnt updated even when location is matched. We might need to forcibly set the record for the route as it appears that history.replaceState isn't doing what it's supposed to as far as triggering a route change event.

 else if (
      e.detail.location.route.name === "home" &&
      e.detail.location.search.startsWith("?p=/") &&
      this.lookupRoute(
        e.detail.location.search.replace("?p=/", "").split("&")[0],
      )
    ) {
      let item = this.lookupRoute(
        e.detail.location.search.replace("?p=/", "").split("&")[0],
      )[0];
      store.activeId = item.id;
      globalThis.history.replaceState(
        {},
        null,
        e.detail.location.search.replace("?p=/", "").split("&")[0],
      );
      e.detail.location.search = e.detail.location.search.replace("?p=/", "").split("&")[0];
      store.location = e.detail.location;