mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-25 02:22:58 +01:00
🚑 Fix issue with new api addon shema #160
This commit is contained in:
parent
9de8584a5e
commit
a3f92e4744
@ -61,18 +61,12 @@ function getAddonList() {
|
|||||||
statusTools.setStatus(status);
|
statusTools.setStatus(status);
|
||||||
}
|
}
|
||||||
let addons = result.body.data.addons;
|
let addons = result.body.data.addons;
|
||||||
let installed = [];
|
addons.sort((a, b) => {
|
||||||
for (let current of addons) {
|
|
||||||
if (current.installed === true) {
|
|
||||||
installed.push({ slug: current.slug, name: current.name })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
installed.sort((a, b) => {
|
|
||||||
let textA = a.name.toUpperCase();
|
let textA = a.name.toUpperCase();
|
||||||
let textB = b.name.toUpperCase();
|
let textB = b.name.toUpperCase();
|
||||||
return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
|
return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
|
||||||
});
|
});
|
||||||
resolve(installed);
|
resolve(addons);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
statusTools.setError(`Fail to fetch addons list (${error.message})`, 1);
|
statusTools.setError(`Fail to fetch addons list (${error.message})`, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user