mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-19 12:18:51 +00:00
move _nodeEnv setup into master
This commit is contained in:
parent
0088ea516b
commit
b2d6596f92
4 changed files with 6 additions and 2 deletions
|
|
@ -20,7 +20,9 @@ model = void 0;
|
|||
setModel = function(m) {
|
||||
model = m;
|
||||
user = model.at('_user');
|
||||
return setupNotifications();
|
||||
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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue