mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 12:01:17 +01:00
This commit is contained in:
5
app.js
5
app.js
@@ -150,8 +150,6 @@ function start() {
|
||||
plugins = require('./src/plugins'),
|
||||
upgrade = require('./src/upgrade');
|
||||
|
||||
meta.themes.setupPaths();
|
||||
|
||||
templates.setGlobal('relative_path', nconf.get('relative_path'));
|
||||
|
||||
upgrade.check(function(schema_ok) {
|
||||
@@ -159,12 +157,13 @@ function start() {
|
||||
webserver.init();
|
||||
sockets.init(webserver.server);
|
||||
|
||||
if (nconf.get('isPrimary')) {
|
||||
if (nconf.get('isPrimary') === 'true') {
|
||||
require('./src/notifications').init();
|
||||
require('./src/user').startJobs();
|
||||
}
|
||||
|
||||
async.waterfall([
|
||||
async.apply(meta.themes.setupPaths),
|
||||
async.apply(plugins.ready),
|
||||
async.apply(meta.templates.compile),
|
||||
async.apply(webserver.listen)
|
||||
|
||||
@@ -108,7 +108,7 @@ module.exports = function(Meta) {
|
||||
}
|
||||
};
|
||||
|
||||
Meta.themes.setupPaths = function() {
|
||||
Meta.themes.setupPaths = function(callback) {
|
||||
async.parallel({
|
||||
themesData: Meta.themes.get,
|
||||
currentThemeId: function(next) {
|
||||
@@ -116,7 +116,7 @@ module.exports = function(Meta) {
|
||||
}
|
||||
}, function(err, data) {
|
||||
if (err) {
|
||||
return winston.error(err.stack);
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
var themeId = data.currentThemeId || 'nodebb-theme-vanilla';
|
||||
@@ -125,12 +125,16 @@ module.exports = function(Meta) {
|
||||
return themeObj.id === themeId;
|
||||
})[0];
|
||||
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
winston.info('[themes] Using theme ' + themeId);
|
||||
}
|
||||
|
||||
if (!themeObj) {
|
||||
return callback(new Error('[[error:theme-not-found]]'));
|
||||
}
|
||||
|
||||
Meta.themes.setPath(themeObj);
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user