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 +++++++------- server.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) 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 () { diff --git a/server.js b/server.js index 4a8bfe5..60c1bdd 100755 --- a/server.js +++ b/server.js @@ -23,7 +23,7 @@ var express = require('express'), var rootFolder = path.resolve(__dirname, process.argv[2] || 'files'); -var configFile = path.resolve(__dirname, process.argv[3] || './config.json'); +var configFile = path.resolve(__dirname, process.argv[3] || '.config.json'); // Ensure the root folder exists mkdirp.sync(rootFolder); -- cgit v1.2.3