Fix error condition rendering.

This commit is contained in:
Dermot Duffy
2022-01-14 21:31:16 -08:00
parent c40c63862e
commit 915053261e
5 changed files with 138 additions and 137 deletions
+6 -3
View File
@@ -255,7 +255,7 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
*/
protected _renderCameraHeader(
cameraIndex: number,
cameraConfig: RawFrigateCardConfig | undefined,
cameraConfig?: RawFrigateCardConfig,
addNewCamera?: boolean,
): TemplateResult {
return html`
@@ -275,11 +275,10 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
// starting with the most likely to be useful and working our
// ways towards the least useful.
html` <span>
Camera:
${cameraConfig?.title ||
cameraConfig?.camera_entity ||
cameraConfig?.card_id ||
[
cameraConfig?.camera_entity,
cameraConfig?.client_id,
cameraConfig?.camera_name,
cameraConfig?.label,
@@ -771,6 +770,10 @@ export class FrigateCardEditor extends LitElement implements LovelaceCardEditor
return;
}
if (getConfigValue(this._config, key) === value) {
return;
}
const newConfig = copyConfig(this._config);
if (value === '' || typeof value === 'undefined') {
deleteConfigValue(newConfig, key);