Understood.
import { hbs } from "ember-cli-htmlbars";
Functionally I’m trying to swap the logo depending on the route. In reality I’m doing this by attaching an image to the home logo on some routes and overlaying the primary logo. I want that logic to be re-evaluated when moving between routes, which currently seems to work moving in and out of the Topic routes I’m guessing because the header-contents widget to which everything is attached has logic evaluating the attrs.topic which obviously changes when that occurs.
My category-logo-widget is attached like so:
api.decorateWidget("home-logo:after", (helper) => {
const currentPath = helper.register
.lookup("service:router")
.get("_router.currentPath");
if (
helper.widget.currentUser &&
!helper.widget.site.mobileView &&
currentPath.indexOf("discovery") === -1
) {
return helper.attach("category-logo-widget");
}
});
Which works fine, but is not being re-evaluated between certain route transitions, so isn’t fulfilling the requirement fully dynamically without a page reload.
oooooops, this could be the issue, I had a feeling it might be but my tests were obviously too superficial to rule this out.
I see this commit, I’ll need to update my dev instance … PERF: Memoize element references for `dockCheck` (#21079) · discourse/discourse@db16700 · GitHub
I’ll revert either way, thanks for your time!