mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 10:59:50 +00:00
Don't throw errors in card picker (#6188)
This commit is contained in:
@@ -14,6 +14,7 @@ import "../cards/hui-weather-forecast-card";
|
||||
import {
|
||||
createLovelaceElement,
|
||||
getLovelaceElementClass,
|
||||
tryCreateLovelaceElement,
|
||||
} from "./create-element-base";
|
||||
|
||||
const ALWAYS_LOADED_TYPES = new Set([
|
||||
@@ -52,6 +53,17 @@ const LAZY_LOAD_TYPES = {
|
||||
picture: () => import("../cards/hui-picture-card"),
|
||||
};
|
||||
|
||||
// This will not return an error card but will throw the error
|
||||
export const tryCreateCardElement = (config: LovelaceCardConfig) =>
|
||||
tryCreateLovelaceElement(
|
||||
"card",
|
||||
config,
|
||||
ALWAYS_LOADED_TYPES,
|
||||
LAZY_LOAD_TYPES,
|
||||
undefined,
|
||||
undefined
|
||||
);
|
||||
|
||||
export const createCardElement = (config: LovelaceCardConfig) =>
|
||||
createLovelaceElement(
|
||||
"card",
|
||||
|
||||
Reference in New Issue
Block a user