Fix history not loading on channel switch

This commit is contained in:
Pavel Djundik 2018-07-10 17:17:28 +03:00 committed by Pavel Djundik
parent 207ab28b92
commit 2ab3518c52

View File

@ -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;