mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-17 23:54:28 +01:00
Fix My link missing repository_url for app pages
The "m" shortcut to create My Home Assistant links was not including the repository_url parameter for app pages. Two issues fixed: 1. optional_params from redirect config were never processed in _createMyLink 2. ha-config-app-dashboard was stripping repository_url from the URL on load https://claude.ai/code/session_019Pcu6GyizXJAUCWtrxCVg5
This commit is contained in:
@@ -63,9 +63,12 @@ class HaConfigAppDashboard extends LitElement {
|
|||||||
this._fromStore = extractSearchParam("store") === "true";
|
this._fromStore = extractSearchParam("store") === "true";
|
||||||
const repositoryUrl = extractSearchParam("repository_url");
|
const repositoryUrl = extractSearchParam("repository_url");
|
||||||
if (repositoryUrl) {
|
if (repositoryUrl) {
|
||||||
navigate(`/config/app/${this.route.path.split("/")[1]}`, {
|
navigate(
|
||||||
replace: true,
|
`/config/app/${this.route.path.split("/")[1]}?repository_url=${encodeURIComponent(repositoryUrl)}`,
|
||||||
});
|
{
|
||||||
|
replace: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
await this._loadAddon(repositoryUrl);
|
await this._loadAddon(repositoryUrl);
|
||||||
this.addEventListener("hass-api-called", (ev) => this._apiCalled(ev));
|
this.addEventListener("hass-api-called", (ev) => this._apiCalled(ev));
|
||||||
|
|||||||
@@ -290,6 +290,14 @@ export default <T extends Constructor<HassElement>>(superClass: T) =>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (redirect.optional_params) {
|
||||||
|
const params = extractSearchParamsObject();
|
||||||
|
for (const key of Object.keys(redirect.optional_params)) {
|
||||||
|
if (key in params) {
|
||||||
|
myParams.append(key, params[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (redirect.redirect === "/config/integrations/integration") {
|
if (redirect.redirect === "/config/integrations/integration") {
|
||||||
myParams.append("domain", targetPath.split("/")[4]);
|
myParams.append("domain", targetPath.split("/")[4]);
|
||||||
} else if (redirect.redirect === "/config/app") {
|
} else if (redirect.redirect === "/config/app") {
|
||||||
|
|||||||
Reference in New Issue
Block a user