Skip to content

Commit 0523a7a

Browse files
committed
https://quickblox.atlassian.net/browse/QBWEBSDK-251
1 parent b2ea60c commit 0523a7a

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

samples/webrtc/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h3 class="join__title">
4444
</div>
4545

4646
<div class="join__row">
47-
<input type="text" class="join__input" name="room" placeholder="Chat room name" required title="Should contain only latin characters and alphanumeric characters in a range from 3 to 15, without space." pattern="^\s[a-zA-Z][a-zA-Z\d]{3,15}\s$">
47+
<input type="text" class="join__input" name="room" placeholder="Chat room name" required title="Should contain only latin characters and alphanumeric characters in a range from 3 to 15, without space." pattern="^[a-zA-Z\s][a-zA-Z\d\s]{3,15}$">
4848
</div>
4949

5050
<div class="join__row">

samples/webrtc/js/app.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
'container': $('.page'),
3939
'relocated': function() {
40-
var path = app.user ? 'dashboard' : 'join';
40+
var path = app.caller ? 'dashboard' : 'join';
4141

4242
app.router.navigate(path, {'trigger': true});
4343
},
@@ -471,13 +471,18 @@
471471

472472
/** LOGOUT */
473473
$(document).on('click', '.j-logout', function() {
474-
app.user = null;
475-
app.users = [];
474+
QB.users.delete(app.caller.id, function(err, user){
475+
if (user) {
476+
app.caller = {};
477+
app.users = [];
476478

477-
QB.chat.disconnect();
478-
app.router.navigate('join', {'trigger': true});
479-
480-
app.helpers.setFooterPosition();
479+
QB.chat.disconnect();
480+
app.router.navigate('join', {'trigger': true});
481+
app.helpers.setFooterPosition();
482+
} else {
483+
console.error('Logout failed:', err);
484+
}
485+
});
481486
});
482487

483488
/**

0 commit comments

Comments
 (0)