fix shoutbox header, use custom scroll-to-bottom system, remove vue-chat-scroll, temporarily add chat test hack

This commit is contained in:
Shpuld Shpuldson 2021-03-03 16:46:53 +02:00
parent 30057a4944
commit 0673511fc2
7 changed files with 42 additions and 13 deletions

View file

@ -18,6 +18,25 @@ const chat = {
actions: {
initializeChat (store, socket) {
const channel = socket.channel('chat:public')
let id = 0
const createmsg = () => {
id += 1
return {
text: 'test' + id,
author: {
username: 'test',
avatar: '',
id
}
}
}
const loop = () => {
store.commit('addMessage', createmsg())
setTimeout(loop, 3000)
}
loop()
channel.on('new_msg', (msg) => {
store.commit('addMessage', msg)
})