Editing topic title/category or tag does not re-render docked header

In cases where components don’t exist in a hierarchy (for example, header and main body) I prefer to use our injected appEvents object to signal things like this. In fact, there is already a header:show-topic event that is triggered when the topic is changed while browsing around. So the fix was just to trigger that after the topic was updated:

https://github.com/discourse/discourse/commit/05e99a68cec550eb3b1aa9703bdca462e74303e7

Over time I learned to loathe observers. They still have some uses in our codebase but if there’s a way I can instead say “okay, signal that something changed”, preferably by action handler, I’ll always do that.

8 Likes