Use name (not display name) on saving

This commit is contained in:
Adria Navarro 2024-07-22 16:40:00 +02:00
parent b7fc1cddb7
commit d01bd54fd1
2 changed files with 4 additions and 4 deletions

View File

@ -89,7 +89,7 @@
on:contextmenu={openContextMenu} on:contextmenu={openContextMenu}
{icon} {icon}
iconColor={"var(--spectrum-global-color-gray-900)"} iconColor={"var(--spectrum-global-color-gray-900)"}
text={automation.name} text={automation.displayName}
selected={automation._id === $selectedAutomation?._id} selected={automation._id === $selectedAutomation?._id}
hovering={automation._id === $contextMenuStore.id} hovering={automation._id === $contextMenuStore.id}
on:click={() => automationStore.actions.select(automation._id)} on:click={() => automationStore.actions.select(automation._id)}

View File

@ -19,13 +19,13 @@
}) })
.map(automation => ({ .map(automation => ({
...automation, ...automation,
name: displayName:
$automationStore.automationDisplayData[automation._id].displayName || $automationStore.automationDisplayData[automation._id].displayName ||
automation.name, automation.name,
})) }))
.sort((a, b) => { .sort((a, b) => {
const lowerA = a.name.toLowerCase() const lowerA = a.displayName.toLowerCase()
const lowerB = b.name.toLowerCase() const lowerB = b.displayName.toLowerCase()
return lowerA > lowerB ? 1 : -1 return lowerA > lowerB ? 1 : -1
}) })