From 394694e0067af4b6ca7a9564aae3276aebe01b74 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 11 Apr 2020 23:24:52 +0200 Subject: [PATCH] Simpler way to fetch versions --- src/js/yunohost/main.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/js/yunohost/main.js b/src/js/yunohost/main.js index f651a412..d6e7389b 100644 --- a/src/js/yunohost/main.js +++ b/src/js/yunohost/main.js @@ -181,10 +181,8 @@ sam.store.set('url', window.location.hostname + '/yunohost/api'); if (sam.store.get('connected')) { - this.api('GET', '/diagnosis/show?full', {}, function(data) { - basesystem = data.reports.filter(function(r) { return r.id == "basesystem"; })[0]; - version_info = basesystem.items.filter(function(i) { return (i.meta && i.meta.test && i.meta.test == "ynh_versions"); })[0]; - $('#yunohost-version').html(y18n.t('footer_version', [version_info.data.main_version, version_info.data.repo])); + this.api('GET', '/versions', {}, function(data) { + $('#yunohost-version').html(y18n.t('footer_version', [data.yunohost.version, data.yunohost.repo])); }); }