mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
move _nodeEnv setup into master
This commit is contained in:
@@ -20,7 +20,9 @@ model = void 0;
|
||||
setModel = function(m) {
|
||||
model = m;
|
||||
user = model.at('_user');
|
||||
if (!model.get('_mobileDevice')) {
|
||||
return setupNotifications();
|
||||
}
|
||||
};
|
||||
|
||||
setupNotifications = function() {
|
||||
|
||||
@@ -64,6 +64,7 @@ habitrpgMiddleware = function(req, res, next) {
|
||||
var model;
|
||||
model = req.getModel();
|
||||
model.set('_mobileDevice', /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(req.header('User-Agent')));
|
||||
model.set('_nodeEnv', process.env.NODE_ENV);
|
||||
auth.setRequest(req);
|
||||
auth.newUserAndPurl();
|
||||
return next();
|
||||
|
||||
@@ -55,7 +55,7 @@ module.exports = function(expressApp, root, derby) {
|
||||
model.at('_habitList').push({
|
||||
id: taskId,
|
||||
type: 'habit',
|
||||
text: (title || taskId) + ' *',
|
||||
text: title || taskId,
|
||||
value: 0,
|
||||
up: true,
|
||||
down: true,
|
||||
|
||||
@@ -40,6 +40,7 @@ habitrpgMiddleware = (req, res, next) ->
|
||||
model = req.getModel()
|
||||
## Set _mobileDevice to true or false so view can exclude portions from mobile device
|
||||
model.set '_mobileDevice', /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(req.header 'User-Agent')
|
||||
model.set '_nodeEnv', process.env.NODE_ENV
|
||||
auth.setRequest(req) # Need to pass into auth, so auth can save as private variable used later by EveryAuth
|
||||
auth.newUserAndPurl()
|
||||
next()
|
||||
|
||||
Reference in New Issue
Block a user