Fixed bug in settingsv1

If the saved value was an empty string, then textareas (and more
importantly, select boxes) would not be properly populated with
the saved value.
This commit is contained in:
Julian Lam
2016-04-21 15:30:03 -04:00
parent 352ef81e84
commit ea6d2c35f7
2 changed files with 3 additions and 2 deletions

View File

@@ -53,11 +53,11 @@ define('admin/settings', ['uploader', 'sounds'], function(uploader, sounds) {
} }
} }
} else if (field.is('textarea')) { } else if (field.is('textarea')) {
if (app.config[key]) { if (app.config.hasOwnProperty(key)) {
field.val(app.config[key]); field.val(app.config[key]);
} }
} else if (field.is('select')) { } else if (field.is('select')) {
if (app.config[key]) { if (app.config.hasOwnProperty(key)) {
field.val(app.config[key]); field.val(app.config[key]);
} }
} }

View File

@@ -31,6 +31,7 @@ var Controllers = {
Controllers.home = function(req, res, next) { Controllers.home = function(req, res, next) {
var route = meta.config.homePageRoute || (meta.config.homePageCustom || '').replace(/^\/+/, '') || 'categories'; var route = meta.config.homePageRoute || (meta.config.homePageCustom || '').replace(/^\/+/, '') || 'categories';
console.log(route, meta.config);
user.getSettings(req.uid, function(err, settings) { user.getSettings(req.uid, function(err, settings) {
if (err) { if (err) {