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')
|
@socketio.on('new_message')
|
||||||
def new_message(message):
|
def new_message(message):
|
||||||
# Send message to alls users
|
# Send message to alls users
|
||||||
emit('new_message', {
|
emit('channel-' + str(message['channel']), {
|
||||||
'username': message['username'],
|
'username': message['username'],
|
||||||
'text': message['text']
|
'text': message['text']
|
||||||
},
|
},
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
SECRET_KEY=secret
|
SECRET_KEY=secret
|
||||||
DEBUG=True
|
DEBUG=True
|
||||||
DATABASE="sqlite:///database.sqlite"
|
DATABASE="sqlite:///database.sqlite"
|
||||||
|
DOMAIN=127.0.0.1:5000
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
console.log('Connect')
|
console.log('Connect')
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('new_message', function(msg) {
|
socket.on('channel-' + app.channel, function(msg) {
|
||||||
// Add new message to HTML
|
// Add new message to HTML
|
||||||
let my_messages = app.messages;
|
let my_messages = app.messages;
|
||||||
my_messages.push({
|
my_messages.push({
|
||||||
|
Loading…
Reference in New Issue
Block a user