Fix duplicate messages on channel join

This commit is contained in:
Pavel Djundik 2018-07-11 12:13:38 +03:00 committed by Pavel Djundik
parent 771739cf94
commit c84eee22f2

View File

@ -116,11 +116,11 @@ export default {
}, },
watch: { watch: {
"channel.id"() { "channel.id"() {
if (this.$refs.loadMoreButton) { if (this.channel.moreHistoryAvailable && this.$refs.loadMoreButton) {
this.$nextTick(() => { this.$nextTick(() => {
const bounding = this.$refs.loadMoreButton.getBoundingClientRect(); const bounding = this.$refs.loadMoreButton.getBoundingClientRect();
if (bounding.top >= 0) { if (bounding.width > 0 && bounding.top >= 0) {
this.$refs.loadMoreButton.click(); this.$refs.loadMoreButton.click();
} }
}); });