mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-25 05:47:20 +00:00
Debounce refresh the cloud status if Google events happen (#11721)
This commit is contained in:
parent
5c5459bcaf
commit
9500ac498c
@ -12,6 +12,7 @@ import "../../../../components/buttons/ha-call-api-button";
|
||||
import "../../../../components/ha-card";
|
||||
import "../../../../components/ha-button-menu";
|
||||
import "../../../../components/ha-icon-button";
|
||||
import { debounce } from "../../../../common/util/debounce";
|
||||
import {
|
||||
cloudLogout,
|
||||
CloudStatusLoggedIn,
|
||||
@ -219,11 +220,15 @@ export class CloudAccount extends SubscribeMixin(LitElement) {
|
||||
}
|
||||
|
||||
protected override hassSubscribe() {
|
||||
const googleCheck = () => {
|
||||
if (!this.cloudStatus?.google_registered) {
|
||||
fireEvent(this, "ha-refresh-cloud-status");
|
||||
}
|
||||
};
|
||||
const googleCheck = debounce(
|
||||
() => {
|
||||
if (this.cloudStatus && !this.cloudStatus.google_registered) {
|
||||
fireEvent(this, "ha-refresh-cloud-status");
|
||||
}
|
||||
},
|
||||
10000,
|
||||
true
|
||||
);
|
||||
return [
|
||||
this.hass.connection.subscribeEvents(() => {
|
||||
if (!this.cloudStatus?.alexa_registered) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user