Skip to content

Commit

Permalink
Add download option to quick actions (#750)
Browse files Browse the repository at this point in the history
* Add download option to quick actions

* Fix icon
  • Loading branch information
ludeeus authored Jul 4, 2024
1 parent 984bd39 commit 4c6b930
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/components/hacs-repository-owerflow-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
mdiAlertCircleOutline,
mdiArrowDownCircle,
mdiClose,
mdiDownload,
mdiGithub,
mdiInformation,
mdiLanguageJavascript,
Expand Down Expand Up @@ -48,26 +49,24 @@ export const repositoryMenuItems = memoizeOne(
await repositoryUpdate(element.hass, String(repository.id));
},
},

...(repository.installed_version
{
path: repository.installed_version ? mdiReload : mdiDownload,
label: element.hacs.localize(
repository.installed_version ? "repository_card.redownload" : "common.download",
),
action: () =>
showHacsDownloadDialog(element, { hacs: element.hacs, repositoryId: repository.id }),
hideForUninstalled: true,
},
...(repository.new
? [
{
path: mdiReload,
label: element.hacs.localize("repository_card.redownload"),
action: () =>
showHacsDownloadDialog(element, { hacs: element.hacs, repositoryId: repository.id }),
hideForUninstalled: true,
path: mdiMoonNew,
label: element.hacs.localize("repository_card.dismiss_new"),
action: () => repositoriesClearNewRepository(element.hass, repository.id),
},
]
: repository.new
? [
{
path: mdiMoonNew,
label: element.hacs.localize("repository_card.dismiss_new"),
action: () => repositoriesClearNewRepository(element.hass, repository.id),
},
]
: []),
: []),
...(repository.category === "plugin" && repository.installed_version
? [
{
Expand Down

0 comments on commit 4c6b930

Please sign in to comment.