Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
004ae179
authored
Jan 14, 2018
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
adding notifications on connection issues
parent
f4c29c41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
sails/src/assets/scripts/modules/student/controllers/student.js
sails/src/assets/scripts/modules/student/controllers/student.js
View file @
004ae179
...
@@ -56,6 +56,13 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
...
@@ -56,6 +56,13 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
}
}
});
});
io
.
socket
.
on
(
'disconnect'
,
function
()
{
$scope
.
studentData
.
pcb_count
=
0
;
$scope
.
studentData
.
pdb_count
=
0
;
$scope
.
$apply
();
ngToast
.
warning
(
$translate
.
instant
(
'no_subscribed'
));
});
io
.
socket
.
on
(
'reconnect'
,
function
()
{
io
.
socket
.
on
(
'reconnect'
,
function
()
{
// Subscribe to student's socket room
// Subscribe to student's socket room
io
.
socket
.
post
(
'/stu/subscribe'
,
{
io
.
socket
.
post
(
'/stu/subscribe'
,
{
...
@@ -67,7 +74,7 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
...
@@ -67,7 +74,7 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
token
:
$window
.
sessionStorage
.
token
token
:
$window
.
sessionStorage
.
token
},
},
function
()
{
function
()
{
// TODO ngToast res.msg (connected to student room)
ngToast
.
warning
(
$translate
.
instant
(
'subscribed'
));
});
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment