Skip to content

Commit

Permalink
Fix chat demo
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Apr 20, 2016
1 parent adba92f commit efc7352
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions demos/chat/aiohttpdemo_chat/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
log('Connected as ' + name);
update_ui();
break;
case 'disconnect':
name = data.name;
log('Disconnected ' + name);
update_ui();
break;
case 'join':
log('Joined ' + data.name);
break;
Expand Down
2 changes: 1 addition & 1 deletion demos/chat/aiohttpdemo_chat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def index(request):
else:
break

request.app['sockets'].remove(resp)
del request.app['sockets'][name]
log.info('%s disconnected.', name)
for ws in request.app['sockets'].values():
ws.send_str(json.dumps({'action': 'disconnect',
Expand Down

0 comments on commit efc7352

Please sign in to comment.