Fixbug
This commit is contained in:
parent
ffb8f26efb
commit
a0849ce1b2
2
app.py
2
app.py
@ -39,7 +39,7 @@ def open_chat(channel, name):
|
||||
@socketio.on('new_message')
|
||||
def new_message(message):
|
||||
# Send message to alls users
|
||||
emit('new_message', {
|
||||
emit('channel-' + str(message['channel']), {
|
||||
'username': message['username'],
|
||||
'text': message['text']
|
||||
},
|
||||
|
@ -1,3 +1,4 @@
|
||||
SECRET_KEY=secret
|
||||
DEBUG=True
|
||||
DATABASE="sqlite:///database.sqlite"
|
||||
DOMAIN=127.0.0.1:5000
|
||||
|
@ -72,7 +72,7 @@
|
||||
console.log('Connect')
|
||||
});
|
||||
|
||||
socket.on('new_message', function(msg) {
|
||||
socket.on('channel-' + app.channel, function(msg) {
|
||||
// Add new message to HTML
|
||||
let my_messages = app.messages;
|
||||
my_messages.push({
|
||||
|
Loading…
Reference in New Issue
Block a user