Only attempt to get "trace/contexts" if admin (#9378)

* Only attempt to get "trace/contexts" if admin

* Changes from review
This commit is contained in:
Philip Allgaier 2021-06-15 16:38:37 +02:00 committed by GitHub
parent 0e3eed0563
commit 6e50d1166a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -127,7 +127,7 @@ export class MoreInfoLogbook extends LitElement {
this.entityId,
true
),
loadTraceContexts(this.hass),
this.hass.user?.is_admin ? loadTraceContexts(this.hass) : {},
this._fetchUserPromise,
]);
this._logbookEntries = this._logbookEntries

View File

@ -257,7 +257,9 @@ export class HaPanelLogbook extends LitElement {
this._endDate.toISOString(),
this._entityId
),
isComponentLoaded(this.hass, "trace") ? loadTraceContexts(this.hass) : {},
isComponentLoaded(this.hass, "trace") && this.hass.user?.is_admin
? loadTraceContexts(this.hass)
: {},
this._fetchUserPromise,
]);