fixed #74 and a problem with lost rooms

parent 553c6402
......@@ -169,6 +169,7 @@ module.exports = function roomsHook (sails) {
*/
disconnect: function(socket) {
var rooms = socketRooms[sails.sockets.getId(socket)];
if (!rooms) return;
for (var i = 0; i < rooms.length; i++)
sails.hooks.rooms.unsubscribeFromRoom(rooms[i].room, socket);
}
......
......@@ -322,6 +322,9 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
// Returned data from the modal window
modalInstance.result.then(function (pictoId) {
if (!pictoId)
return;
// Send the picto to the server
$http.put(config.backend + '/stu/' + $scope.studentData.id + '/cat', {
prev_id_stu_pic: picto_cat.id,
......
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