pictos no mostrados en sesión, corregido

parent b791bd7d
...@@ -47,6 +47,9 @@ android { ...@@ -47,6 +47,9 @@ android {
LocalFlavor { LocalFlavor {
resValue "string", "server", "https://192.168.1.37:1337" resValue "string", "server", "https://192.168.1.37:1337"
} }
DevFlavor {
resValue "string", "server", "https://dev.yottacode.com"
}
DefaultFlavor { DefaultFlavor {
resValue "string", "server", "https://pre.yottacode.com" resValue "string", "server", "https://pre.yottacode.com"
signingConfig signingConfigs.release_config signingConfig signingConfigs.release_config
......
...@@ -1015,15 +1015,17 @@ module.exports = { ...@@ -1015,15 +1015,17 @@ module.exports = {
sails.log.debug("Inside action. Student:" + attributes.id_stu); sails.log.debug("Inside action. Student:" + attributes.id_stu);
if (req.isSocket) { if (req.isSocket) {
sails.log.debug("websockets - room " + roomName); sails.log.debug("websockets - room " + sails.hooks.rooms.student(attributes.id_stu));
// BROADCAST to everyone subscribed to this student // BROADCAST to everyone subscribed to this student
const socketToOmit = (req.isSocket) ? req.socket : undefined; const socketToOmit = (req.isSocket) ? req.socket : undefined;
sails.hooks.events.broadcast( sails.hooks.events.broadcastEvent(
sails.hooks.rooms.student(attributes.id_stu), sails.hooks.rooms.student(attributes.id_stu),
'action',
{ {
name: 'action',
data: {
"action": action, "action": action,
"attributes": attributes "attributes": attributes
}
}, },
socketToOmit socketToOmit
); );
...@@ -1043,8 +1045,10 @@ module.exports = { ...@@ -1043,8 +1045,10 @@ module.exports = {
description: desc description: desc
}) })
.exec(function (err, created) { .exec(function (err, created) {
if (err) if (err) {
sails.log.error(err.details);
res.serverError(err.details); res.serverError(err.details);
}
else if (created) else if (created)
res.json({ res.json({
action: created action: created
...@@ -1056,6 +1060,8 @@ module.exports = { ...@@ -1056,6 +1060,8 @@ module.exports = {
msg: "Action "+ action +" action from student " + attributes.id_stu msg: "Action "+ action +" action from student " + attributes.id_stu
}); });
*/ */
} else {
sails.log.debug("No socket request for action");
} }
}, },
...@@ -1070,7 +1076,7 @@ module.exports = { ...@@ -1070,7 +1076,7 @@ module.exports = {
if (req.isSocket) { if (req.isSocket) {
const socketToOmit = (req.isSocket) ? req.socket : undefined; const socketToOmit = (req.isSocket) ? req.socket : undefined;
sails.hooks.events.broadcast( sails.hooks.events.broadcastEvent(
sails.hooks.rooms.student(attributes.id_stu), sails.hooks.rooms.student(attributes.id_stu),
'action', 'action',
{ {
......
// @TODO 357 // @TODO 357
module.exports = { module.exports = {
// create action // create action
// adds a try // adds a try
// //
create: function(req, res) { create: function(req, res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment