From c84eee22f225f9fd003afb6ee9b045667527d635 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 11 Jul 2018 12:13:38 +0300 Subject: [PATCH] Fix duplicate messages on channel join --- client/components/Chat.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/components/Chat.vue b/client/components/Chat.vue index d9bff463..8d616e77 100644 --- a/client/components/Chat.vue +++ b/client/components/Chat.vue @@ -116,11 +116,11 @@ export default { }, watch: { "channel.id"() { - if (this.$refs.loadMoreButton) { + if (this.channel.moreHistoryAvailable && this.$refs.loadMoreButton) { this.$nextTick(() => { const bounding = this.$refs.loadMoreButton.getBoundingClientRect(); - if (bounding.top >= 0) { + if (bounding.width > 0 && bounding.top >= 0) { this.$refs.loadMoreButton.click(); } });