Skip to content

Commit 7b3873e

Browse files
committed
Prioritize panel config over route for add-on slug
When determining which add-on to load, check the panel config first before falling back to the route path. This allows dedicated add-on panels to always use their configured add-on regardless of the URL path.
1 parent bfa4b91 commit 7b3873e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/panels/app/ha-panel-app.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,18 @@ class HaPanelApp extends LitElement {
113113
route?: Route,
114114
panel?: PanelInfo<AppPanelConfig>
115115
): string | undefined {
116-
// First check route path (e.g., /app/core_configurator)
116+
// First check panel config (for dedicated add-on panels)
117+
if (panel?.config?.addon) {
118+
return panel.config.addon;
119+
}
120+
// Fall back to route path (e.g., /app/core_configurator)
117121
if (route?.path) {
118122
const slug = route.path.substring(1);
119123
if (slug) {
120124
return slug;
121125
}
122126
}
123-
// Fall back to panel config
124-
return panel?.config?.addon;
127+
return undefined;
125128
}
126129

127130
private async _fetchData(addonSlug: string) {

0 commit comments

Comments
 (0)