Reset the query on grid change in a smarter way.

This commit is contained in:
Dermot Duffy
2023-08-11 19:49:42 -07:00
parent fe2adb5b89
commit cc77caa96d
10 changed files with 116 additions and 108 deletions
+7 -2
View File
@@ -363,7 +363,12 @@ export class FrigateCardLiveGrid extends LitElement {
protected _needsGrid(): boolean {
const cameraIDs = this.cameraManager?.getStore().getVisibleCameraIDs();
return !!this.view?.isGrid() && !!cameraIDs && cameraIDs.size >= 1;
return (
!!this.view?.isGrid() &&
!!this.view?.supportsMultipleDisplayModes() &&
!!cameraIDs &&
cameraIDs.size > 1
);
}
protected willUpdate(changedProps: PropertyValues): void {
@@ -377,7 +382,7 @@ export class FrigateCardLiveGrid extends LitElement {
return;
}
const cameraIDs = this.cameraManager?.getStore().getVisibleCameraIDs();
if (!this._needsGrid() || !cameraIDs) {
if (!cameraIDs || !this._needsGrid()) {
return this._renderCarousel();
}
return html`