From f43b3c162f5a0857d9fd56f4d8005763fcdca4cc Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 17 May 2018 16:02:00 +0200 Subject: Fixup the config file usage --- frontend/js/app.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'frontend/js/app.js') diff --git a/frontend/js/app.js b/frontend/js/app.js index e9d469b..6303a89 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -35,7 +35,13 @@ function getProfile(accessToken, callback) { app.session.username = result.body.username; app.session.valid = true; - callback(); + superagent.get('/api/settings').query({ access_token: localStorage.accessToken }).end(function (error, result) { + if (error) console.error(error); + + app.folderListingEnabled = !!result.body.folderListingEnabled; + + callback(); + }); }); } @@ -339,12 +345,6 @@ getProfile(localStorage.accessToken, function (error) { if (error) return console.error(error); loadDirectory(window.location.hash.slice(1)); - - superagent.get('/api/settings').query({ access_token: localStorage.accessToken }).end(function (error, result) { - if (error) console.error(error); - - app.folderListingEnabled = !!result.body.folderListingEnabled; - }); }); $(window).on('hashchange', function () { -- cgit v1.2.3