From 7eb2736d602c9ffb572c7e5fe81b54980d75ef20 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Mon, 3 Jul 2017 12:16:44 -0700 Subject: [PATCH] dismiss tweets if they time out --- public/js/app.js | 4 ++++ resources/assets/js/components/TweetQueue.vue | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/public/js/app.js b/public/js/app.js index 11380fd..144c4a4 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -46532,6 +46532,10 @@ module.exports = { Echo.channel('tweet-queue').listen('NewTweetEvent', function (e) { if (_this.findTweetInQueue(e.tweet_id) === false) { _this.queue.push(e); + // If the new tweet is one that timed out, dismiss it + if (_this.show && _this.tweet.tweet_id == e.tweet_id) { + _this.dismissTweet(); + } } }).listen('TweetClaimedEvent', function (e) { _this.removeTweetFromQueue(e.tweet_id); diff --git a/resources/assets/js/components/TweetQueue.vue b/resources/assets/js/components/TweetQueue.vue index b793ac2..55c462d 100644 --- a/resources/assets/js/components/TweetQueue.vue +++ b/resources/assets/js/components/TweetQueue.vue @@ -44,6 +44,10 @@ module.exports = { .listen('NewTweetEvent', (e) => { if(this.findTweetInQueue(e.tweet_id) === false) { this.queue.push(e); + // If the new tweet is one that timed out, dismiss it + if(this.show && this.tweet.tweet_id == e.tweet_id) { + this.dismissTweet(); + } } }) .listen('TweetClaimedEvent', (e) => {