diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 2d1c2601..b68a06aa 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -489,12 +489,14 @@ // App installation form app.get('#/apps/install/:app', function (c) { c.api('/apps?raw', function(data) { // http://api.yunohost.org/#!/app/app_list_get_8 - if (dataraw[v['id']]['state'] === "validated") + var app_name = c.params["app"]; + var app_infos = data[app_name]; + if (app_infos['state'] === "validated") { - dataraw[v['id']]['state'] = "official"; + app_infos['state'] = "official"; } - var state_color = stateToColor(data[c.params['app']]['state']); - var level_color = levelToColor(parseInt(data[c.params['app']]['level'])); + var state_color = stateToColor(app_infos['state']); + var level_color = levelToColor(parseInt(app_infos['level'])); var is_safe_for_install_color = combineColors(state_color, level_color); if ((is_safe_for_install_color === "warning") || (is_safe_for_install_color === "danger")) @@ -504,8 +506,8 @@ y18n.t("confirm_install_app_"+is_safe_for_install_color), function(){ c.appInstallForm( - c.params['app'], - data[c.params['app']].manifest, + app_name, + app_infos.manifest, c.params ); },