Commit f43b3c16 by Johannes Zellner

Fixup the config file usage

1 parent 552d44bb
Showing with 8 additions and 8 deletions
...@@ -35,7 +35,13 @@ function getProfile(accessToken, callback) { ...@@ -35,7 +35,13 @@ function getProfile(accessToken, callback) {
app.session.username = result.body.username; app.session.username = result.body.username;
app.session.valid = true; 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) { ...@@ -339,12 +345,6 @@ getProfile(localStorage.accessToken, function (error) {
if (error) return console.error(error); if (error) return console.error(error);
loadDirectory(window.location.hash.slice(1)); 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 () { $(window).on('hashchange', function () {
......
...@@ -23,7 +23,7 @@ var express = require('express'), ...@@ -23,7 +23,7 @@ var express = require('express'),
var rootFolder = path.resolve(__dirname, process.argv[2] || 'files'); 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 // Ensure the root folder exists
mkdirp.sync(rootFolder); mkdirp.sync(rootFolder);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!