diff options
author | Johannes Zellner <johannes@cloudron.io> | 2018-05-17 16:02:00 +0200 |
---|---|---|
committer | Johannes Zellner <johannes@cloudron.io> | 2018-05-17 16:02:00 +0200 |
commit | f43b3c162f5a0857d9fd56f4d8005763fcdca4cc (patch) | |
tree | c3951b0cfe5e584bb207545926e4c67cf78dbcfa | |
parent | 552d44bbd28eb66c05b450f112ce20bff463fe6f (diff) | |
download | Surfer-f43b3c162f5a0857d9fd56f4d8005763fcdca4cc.tar.gz Surfer-f43b3c162f5a0857d9fd56f4d8005763fcdca4cc.tar.zst Surfer-f43b3c162f5a0857d9fd56f4d8005763fcdca4cc.zip |
Fixup the config file usage
-rw-r--r-- | frontend/js/app.js | 14 | ||||
-rwxr-xr-x | 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) { | |||
35 | app.session.username = result.body.username; | 35 | app.session.username = result.body.username; |
36 | app.session.valid = true; | 36 | app.session.valid = true; |
37 | 37 | ||
38 | callback(); | 38 | superagent.get('/api/settings').query({ access_token: localStorage.accessToken }).end(function (error, result) { |
39 | if (error) console.error(error); | ||
40 | |||
41 | app.folderListingEnabled = !!result.body.folderListingEnabled; | ||
42 | |||
43 | callback(); | ||
44 | }); | ||
39 | }); | 45 | }); |
40 | } | 46 | } |
41 | 47 | ||
@@ -339,12 +345,6 @@ getProfile(localStorage.accessToken, function (error) { | |||
339 | if (error) return console.error(error); | 345 | if (error) return console.error(error); |
340 | 346 | ||
341 | loadDirectory(window.location.hash.slice(1)); | 347 | loadDirectory(window.location.hash.slice(1)); |
342 | |||
343 | superagent.get('/api/settings').query({ access_token: localStorage.accessToken }).end(function (error, result) { | ||
344 | if (error) console.error(error); | ||
345 | |||
346 | app.folderListingEnabled = !!result.body.folderListingEnabled; | ||
347 | }); | ||
348 | }); | 348 | }); |
349 | 349 | ||
350 | $(window).on('hashchange', function () { | 350 | $(window).on('hashchange', function () { |
@@ -23,7 +23,7 @@ var express = require('express'), | |||
23 | 23 | ||
24 | 24 | ||
25 | var rootFolder = path.resolve(__dirname, process.argv[2] || 'files'); | 25 | var rootFolder = path.resolve(__dirname, process.argv[2] || 'files'); |
26 | var configFile = path.resolve(__dirname, process.argv[3] || './config.json'); | 26 | var configFile = path.resolve(__dirname, process.argv[3] || '.config.json'); |
27 | 27 | ||
28 | // Ensure the root folder exists | 28 | // Ensure the root folder exists |
29 | mkdirp.sync(rootFolder); | 29 | mkdirp.sync(rootFolder); |