mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 12:56:37 +00:00
Only show loading for slow flow steps to avoid flickering (#26131)
This commit is contained in:
parent
1ded254e5a
commit
9134132ba9
@ -438,7 +438,10 @@ class DataEntryFlowDialog extends LitElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._loading = "loading_step";
|
const delayedLoading = setTimeout(() => {
|
||||||
|
// only show loading for slow steps to avoid flickering
|
||||||
|
this._loading = "loading_step";
|
||||||
|
}, 250);
|
||||||
let _step: DataEntryFlowStep;
|
let _step: DataEntryFlowStep;
|
||||||
try {
|
try {
|
||||||
_step = await step;
|
_step = await step;
|
||||||
@ -452,6 +455,7 @@ class DataEntryFlowDialog extends LitElement {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
|
clearTimeout(delayedLoading);
|
||||||
this._loading = undefined;
|
this._loading = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user