Implement Hello messages for changing name while connected
This commit is contained in:
parent
a136cab1c8
commit
49df598d7d
2 changed files with 7 additions and 1 deletions
|
@ -29,7 +29,11 @@ function initLogin() {
|
||||||
loginForm.join.value = I18n.get('join');
|
loginForm.join.value = I18n.get('join');
|
||||||
loginForm.addEventListener('submit', function(e) {
|
loginForm.addEventListener('submit', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
Session.start(loginForm.you.value);
|
if(!Session.isLoggedIn()) {
|
||||||
|
Session.start(loginForm.you.value);
|
||||||
|
} else {
|
||||||
|
Messaging.send({tag: 'Hello', name: loginForm.you.value});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
loginForm.you.addEventListener("input", validate);
|
loginForm.you.addEventListener("input", validate);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,8 @@ Messaging.addEventListener(["LogIn"], function(o) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Messaging.addEventListener('close', function() {loggedIn = false;});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
is: is,
|
is: is,
|
||||||
getKey: getKey,
|
getKey: getKey,
|
||||||
|
|
Loading…
Reference in a new issue