From 38047b03cfec5e0baa028db95b14ea09858d8162 Mon Sep 17 00:00:00 2001 From: Nero Date: Wed, 23 Sep 2020 12:17:34 +0200 Subject: [PATCH] Fetch reactions in interval --- app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app.js b/app.js index 632538f..e32883f 100644 --- a/app.js +++ b/app.js @@ -65,6 +65,10 @@ let kara = new Vue({ document.getElementById('chatinput').focus(); document.title = this.name; + setInterval(() => { + this.getReactions(); + }, 15000); + this.scrollDown(); }, methods: { @@ -924,6 +928,8 @@ let kara = new Vue({ let Kara = this; axios.get('/reactions/get').then((response) => { + Kara.reactions = []; + response.data.forEach((reaction) => { Kara.reactions.push(JSON.parse(reaction.reaction)); });