diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2021-03-03 16:46:53 +0200 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2021-03-03 16:46:53 +0200 |
| commit | 0673511fc246d67356dd656ad81ba401e3179108 (patch) | |
| tree | 4c142129fde76fdbf9f1d82d213d3964d0152d1c /src/modules/chat.js | |
| parent | 30057a494441b01c0db85ec302aed224cf0768f2 (diff) | |
fix shoutbox header, use custom scroll-to-bottom system, remove vue-chat-scroll, temporarily add chat test hack
Diffstat (limited to 'src/modules/chat.js')
| -rw-r--r-- | src/modules/chat.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/modules/chat.js b/src/modules/chat.js index c798549d..264ba00b 100644 --- a/src/modules/chat.js +++ b/src/modules/chat.js @@ -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) }) |
