From cf196d6458cca32dab504ccfb86b7d4347af94e3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 11 Dec 2018 00:16:59 +0000 Subject: [PATCH] Don't run initial checks each time home page is displayed --- src/js/yunohost/controllers/home.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/js/yunohost/controllers/home.js b/src/js/yunohost/controllers/home.js index 7587fd0f..fb3159fc 100644 --- a/src/js/yunohost/controllers/home.js +++ b/src/js/yunohost/controllers/home.js @@ -3,6 +3,8 @@ var app = Sammy.apps['#main']; var store = app.store; + var initial_checks_already_performed = false; + /** * Home * @@ -10,7 +12,11 @@ // Home page app.get('#/', function (c) { - c.api('/users', function(data) { + if (initial_checks_already_performed) + { + c.view("home"); + } + else c.api('/users', function(data) { // Warn admin if no users are created. if (typeof data.users !== 'undefined' && data.users.length === 0) { c.flash('warning', y18n.t('warning_first_user')); @@ -77,6 +83,7 @@ } }); + initial_checks_already_performed = true; c.view('home'); }); });