1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-02-15 07:25:54 +00:00

Fix device download diagnostic via overflow (#29269)

fix diagnostic download link handling to simplify URL signing
This commit is contained in:
Wendelin
2026-01-30 08:42:40 +01:00
committed by Paul Bottein
parent d44874783a
commit bc22e6a9bd

View File

@@ -1002,9 +1002,8 @@ export class HaConfigDevicePage extends LitElement {
this._diagnosticDownloadLinks = (
links as { link: string; domain: string }[]
).map((link) => ({
href: link.link,
icon: mdiDownload,
action: (ev) => this._signUrl(ev),
action: () => this._signUrl(link.link),
label:
links.length > 1
? this.hass.localize(
@@ -1477,12 +1476,8 @@ export class HaConfigDevicePage extends LitElement {
});
}
private async _signUrl(ev) {
const a = ev.currentTarget.getAttribute("href")
? ev.currentTarget
: ev.currentTarget.closest("a");
const signedUrl = await getSignedPath(this.hass, a.getAttribute("href"));
private async _signUrl(link: string) {
const signedUrl = await getSignedPath(this.hass, link);
fileDownload(signedUrl.path);
}