mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 04:16:34 +00:00
Fix custom card documentation url (#15439)
Fix custom card documentation
This commit is contained in:
parent
714c6aab98
commit
1c5b476bda
@ -154,7 +154,7 @@ const _lazyCreate = <T extends keyof CreateElementConfigTypes>(
|
|||||||
|
|
||||||
const _getCustomTag = (type: string) =>
|
const _getCustomTag = (type: string) =>
|
||||||
type.startsWith(CUSTOM_TYPE_PREFIX)
|
type.startsWith(CUSTOM_TYPE_PREFIX)
|
||||||
? type.substr(CUSTOM_TYPE_PREFIX.length)
|
? type.slice(CUSTOM_TYPE_PREFIX.length)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
export const createLovelaceElement = <T extends keyof CreateElementConfigTypes>(
|
export const createLovelaceElement = <T extends keyof CreateElementConfigTypes>(
|
||||||
|
@ -10,7 +10,8 @@ export const getCardDocumentationURL = (
|
|||||||
type: string
|
type: string
|
||||||
): string | undefined => {
|
): string | undefined => {
|
||||||
if (type.startsWith(CUSTOM_TYPE_PREFIX)) {
|
if (type.startsWith(CUSTOM_TYPE_PREFIX)) {
|
||||||
return getCustomCardEntry(type)?.documentationURL;
|
return getCustomCardEntry(type.slice(CUSTOM_TYPE_PREFIX.length))
|
||||||
|
?.documentationURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${documentationUrl(hass, "/lovelace/")}${type}`;
|
return `${documentationUrl(hass, "/lovelace/")}${type}`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user