Skip to content

Commit 4c6b930

Browse files
authored
Add download option to quick actions (#750)
* Add download option to quick actions * Fix icon
1 parent 984bd39 commit 4c6b930

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

‎src/components/hacs-repository-owerflow-menu.ts‎

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
mdiAlertCircleOutline,
44
mdiArrowDownCircle,
55
mdiClose,
6+
mdiDownload,
67
mdiGithub,
78
mdiInformation,
89
mdiLanguageJavascript,
@@ -48,26 +49,24 @@ export const repositoryMenuItems = memoizeOne(
4849
await repositoryUpdate(element.hass, String(repository.id));
4950
},
5051
},
51-
52-
...(repository.installed_version
52+
{
53+
path: repository.installed_version ? mdiReload : mdiDownload,
54+
label: element.hacs.localize(
55+
repository.installed_version ? "repository_card.redownload" : "common.download",
56+
),
57+
action: () =>
58+
showHacsDownloadDialog(element, { hacs: element.hacs, repositoryId: repository.id }),
59+
hideForUninstalled: true,
60+
},
61+
...(repository.new
5362
? [
5463
{
55-
path: mdiReload,
56-
label: element.hacs.localize("repository_card.redownload"),
57-
action: () =>
58-
showHacsDownloadDialog(element, { hacs: element.hacs, repositoryId: repository.id }),
59-
hideForUninstalled: true,
64+
path: mdiMoonNew,
65+
label: element.hacs.localize("repository_card.dismiss_new"),
66+
action: () => repositoriesClearNewRepository(element.hass, repository.id),
6067
},
6168
]
62-
: repository.new
63-
? [
64-
{
65-
path: mdiMoonNew,
66-
label: element.hacs.localize("repository_card.dismiss_new"),
67-
action: () => repositoriesClearNewRepository(element.hass, repository.id),
68-
},
69-
]
70-
: []),
69+
: []),
7170
...(repository.category === "plugin" && repository.installed_version
7271
? [
7372
{

0 commit comments

Comments
 (0)