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