X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git;a=blobdiff_plain;f=frontend%2Fjs%2Fapp.js;h=6303a892984868c4d496b92efe04c556033e0028;hp=e9d469be99d400656e7107259265c8f2503ece1d;hb=f43b3c162f5a0857d9fd56f4d8005763fcdca4cc;hpb=552d44bbd28eb66c05b450f112ce20bff463fe6f 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 () {