mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
💄 Sort add-ons in the Hass.io add-ons store (#733)
Signed-off-by: Franck Nijhof <frenck@addons.community>
This commit is contained in:
parent
34fd3e4899
commit
36c658096a
@ -91,6 +91,22 @@ class HassioAddonStoreOverview extends window.hassMixins.EventsMixin(Polymer.Ele
|
|||||||
computeAddOns(repo) {
|
computeAddOns(repo) {
|
||||||
return this.addons.filter(function (addon) {
|
return this.addons.filter(function (addon) {
|
||||||
return addon.repository === repo;
|
return addon.repository === repo;
|
||||||
|
}).sort(function (addonA, addonB) {
|
||||||
|
if (addonA.name < addonB.name) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (addonA.name > addonB.name) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}).sort(function (addonA, addonB) {
|
||||||
|
if (addonA.installed && !addonB.installed) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (!addonA.installed && addonB.installed) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user