fix: Show version number with card loading spinner (#1825)

- Closes #1818

**Why add this?**: A repeated pattern is that an issue is fixed in the
card, a new build is released and users will incorrectly believe it's
not yet fixed due to their browser caching the old code. This results in
wasting their time, and my time.

**But it's obnoxious!**: I'm pretty sensitive to this (hence adding
these messages!), so let me know how terrible you find it. You can
disable it with:

```yaml
performance:
  features:
    card_loading_indicator: false
```
This commit is contained in:
Dermot Duffy
2025-01-12 16:26:30 -08:00
committed by GitHub
parent 1f37895793
commit 6b3736bdaf
19 changed files with 67 additions and 13 deletions
+8 -4
View File
@@ -348,9 +348,9 @@ class FrigateCard extends LitElement {
const actions = this._controller.getActionsManager().getMergedActions();
const cameraManager = this._controller.getCameraManager();
const showLoadingSpinner =
this._config?.performance?.features.animated_progress_indicator !== false &&
!this._controller.getInitializationManager().wasEverInitialized() &&
const showLoading =
this._config?.performance?.features.card_loading_indicator !== false &&
!this._controller.getMessageManager().hasMessage();
// Caution: Keep the main div and the menu next to one another in order to
@@ -380,7 +380,11 @@ class FrigateCard extends LitElement {
}
@frigate-card:focus=${() => this.focus()}
>
${showLoadingSpinner ? html`<frigate-card-loading></frigate-card-loading>` : ''}
${showLoading
? html`<frigate-card-loading
?loaded=${this._controller.getInitializationManager().wasEverInitialized()}
></frigate-card-loading>`
: ''}
${this._renderMenuStatusContainer('top')}
${this._renderMenuStatusContainer('overlay')}
<div ${ref(this._refMain)} class="${classMap(mainClasses)}">