mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 03:36:44 +00:00
Sort custom cards in card picker (#20517)
This commit is contained in:
parent
27c53b3241
commit
5317a11c39
@ -278,13 +278,21 @@ export class HuiCardPicker extends LitElement {
|
|||||||
|
|
||||||
if (customCards.length > 0) {
|
if (customCards.length > 0) {
|
||||||
cards = cards.concat(
|
cards = cards.concat(
|
||||||
customCards.map((ccard: CustomCardEntry) => ({
|
customCards
|
||||||
|
.map((ccard: CustomCardEntry) => ({
|
||||||
type: ccard.type,
|
type: ccard.type,
|
||||||
name: ccard.name,
|
name: ccard.name,
|
||||||
description: ccard.description,
|
description: ccard.description,
|
||||||
showElement: ccard.preview,
|
showElement: ccard.preview,
|
||||||
isCustom: true,
|
isCustom: true,
|
||||||
}))
|
}))
|
||||||
|
.sort((a, b) =>
|
||||||
|
stringCompare(
|
||||||
|
a.name || a.type,
|
||||||
|
b.name || b.type,
|
||||||
|
this.hass?.language
|
||||||
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this._cards = cards.map((card: Card) => ({
|
this._cards = cards.map((card: Card) => ({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user