mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-12 11:56:34 +00:00
Hide download diagnostics if config entry is not loaded (#11383)
This commit is contained in:
parent
197b581e8e
commit
cf527e4bc2
@ -210,25 +210,27 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
this._integrations(device, this.entries).map(async (entry) => {
|
this._integrations(device, this.entries)
|
||||||
const info = await fetchDiagnosticHandler(this.hass, entry.domain);
|
.filter((entry) => entry.state === "loaded")
|
||||||
|
.map(async (entry) => {
|
||||||
|
const info = await fetchDiagnosticHandler(this.hass, entry.domain);
|
||||||
|
|
||||||
if (!info.handlers.device && !info.handlers.config_entry) {
|
if (!info.handlers.device && !info.handlers.config_entry) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
const link = info.handlers.device
|
const link = info.handlers.device
|
||||||
? getDeviceDiagnosticsDownloadUrl(entry.entry_id, this.deviceId)
|
? getDeviceDiagnosticsDownloadUrl(entry.entry_id, this.deviceId)
|
||||||
: getConfigEntryDiagnosticsDownloadUrl(entry.entry_id);
|
: getConfigEntryDiagnosticsDownloadUrl(entry.entry_id);
|
||||||
return html`
|
return html`
|
||||||
<a href=${link} @click=${this._signUrl}>
|
<a href=${link} @click=${this._signUrl}>
|
||||||
<mwc-button>
|
<mwc-button>
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
`ui.panel.config.devices.download_diagnostics`
|
`ui.panel.config.devices.download_diagnostics`
|
||||||
)}
|
)}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</a>
|
</a>
|
||||||
`;
|
`;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ export class HaIntegrationCard extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</mwc-list-item>`
|
</mwc-list-item>`
|
||||||
: ""}
|
: ""}
|
||||||
${this.supportsDiagnostics
|
${this.supportsDiagnostics && item.state === "loaded"
|
||||||
? html`<a
|
? html`<a
|
||||||
href=${getConfigEntryDiagnosticsDownloadUrl(item.entry_id)}
|
href=${getConfigEntryDiagnosticsDownloadUrl(item.entry_id)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user