From 2ab3518c52cd2a1cb9f96fa3a58877b9885b412b Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 10 Jul 2018 17:17:28 +0300 Subject: [PATCH] Fix history not loading on channel switch --- client/components/Chat.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/components/Chat.vue b/client/components/Chat.vue index 10c586dc..92e1860d 100644 --- a/client/components/Chat.vue +++ b/client/components/Chat.vue @@ -113,6 +113,17 @@ export default { }, }, watch: { + "channel.id"() { + if (this.$refs.loadMoreButton) { + this.$nextTick(() => { + const bounding = this.$refs.loadMoreButton.getBoundingClientRect(); + + if (bounding.top >= 0) { + this.$refs.loadMoreButton.click(); + } + }); + } + }, "channel.messages"() { const el = this.$refs.chat;