mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
parent
7258e31348
commit
7d432cd11a
@ -139,7 +139,7 @@ export class HaLogbook extends LitElement {
|
|||||||
this._throttleGetLogbookEntries.cancel();
|
this._throttleGetLogbookEntries.cancel();
|
||||||
this._updateTraceContexts.cancel();
|
this._updateTraceContexts.cancel();
|
||||||
this._updateUsers.cancel();
|
this._updateUsers.cancel();
|
||||||
await this._unsubscribeSetLoading();
|
this._unsubscribeSetLoading();
|
||||||
|
|
||||||
if (force) {
|
if (force) {
|
||||||
this._getLogBookData();
|
this._getLogBookData();
|
||||||
@ -206,18 +206,9 @@ export class HaLogbook extends LitElement {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _unsubscribe(): Promise<void> {
|
private _unsubscribe() {
|
||||||
if (this._subscribed) {
|
if (this._subscribed) {
|
||||||
const unsub = await this._subscribed;
|
this._subscribed.then((unsub) => unsub?.());
|
||||||
if (unsub) {
|
|
||||||
try {
|
|
||||||
await unsub();
|
|
||||||
} catch (e) {
|
|
||||||
// The backend will cancel the subscription if
|
|
||||||
// we subscribe to entities that will all be
|
|
||||||
// filtered away
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this._subscribed = undefined;
|
this._subscribed = undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -239,8 +230,8 @@ export class HaLogbook extends LitElement {
|
|||||||
* Setting this._logbookEntries to undefined
|
* Setting this._logbookEntries to undefined
|
||||||
* will put the page in a loading state.
|
* will put the page in a loading state.
|
||||||
*/
|
*/
|
||||||
private async _unsubscribeSetLoading() {
|
private _unsubscribeSetLoading() {
|
||||||
await this._unsubscribe();
|
this._unsubscribe();
|
||||||
this._logbookEntries = undefined;
|
this._logbookEntries = undefined;
|
||||||
this._pendingStreamMessages = [];
|
this._pendingStreamMessages = [];
|
||||||
}
|
}
|
||||||
@ -249,8 +240,8 @@ export class HaLogbook extends LitElement {
|
|||||||
* Setting this._logbookEntries to an empty
|
* Setting this._logbookEntries to an empty
|
||||||
* list will show a no results message.
|
* list will show a no results message.
|
||||||
*/
|
*/
|
||||||
private async _unsubscribeNoResults() {
|
private _unsubscribeNoResults() {
|
||||||
await this._unsubscribe();
|
this._unsubscribe();
|
||||||
this._logbookEntries = [];
|
this._logbookEntries = [];
|
||||||
this._pendingStreamMessages = [];
|
this._pendingStreamMessages = [];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user