Only handle if ref exists

This commit is contained in:
2020-03-20 14:29:23 +01:00
parent c53761d8bf
commit 4e76d707b1
2 changed files with 10 additions and 6 deletions

View File

@@ -24,9 +24,11 @@ export default {
attendees: { attendees: {
deep: true, deep: true,
handler() { handler() {
setTimeout(() => { if (this.$refs && this.$refs.history) {
this.$refs.attendees.scrollTop = this.$refs.attendees.scrollHeight; setTimeout(() => {
}, 50); this.$refs.attendees.scrollTop = this.$refs.attendees.scrollHeight;
}, 50);
}
} }
} }
} }

View File

@@ -53,9 +53,11 @@ export default {
watch: { watch: {
chatHistory: { chatHistory: {
handler() { handler() {
setTimeout(() => { if (this.$refs && this.$refs.history) {
this.$refs.history.scrollTop = this.$refs.history.scrollHeight; setTimeout(() => {
}, 10); this.$refs.history.scrollTop = this.$refs.history.scrollHeight;
}, 10);
}
}, },
deep: true deep: true
} }