From 7e5e031ea8bb65429fbee367159eec1d5e5307c8 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Fri, 13 Jul 2018 23:03:36 +0300 Subject: [PATCH] Reset canDisplay on previews on destroy --- client/components/LinkPreview.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/components/LinkPreview.vue b/client/components/LinkPreview.vue index ad730b46..30c420d2 100644 --- a/client/components/LinkPreview.vue +++ b/client/components/LinkPreview.vue @@ -151,6 +151,11 @@ export default { this.onPreviewUpdate(); }, + destroyed() { + // Let this preview go through load/canplay events again, + // Otherwise the browser can cause a resize on video elements + this.link.canDisplay = false; + }, methods: { onPreviewUpdate() { // Error don't have any media to render @@ -165,7 +170,7 @@ export default { }, onPreviewReady() { const options = require("../js/options"); - this.$set(this.link, "canDisplay", this.link.type !== "loading" && options.shouldOpenMessagePreview(this.link.type)); + this.$set(this.link, "canDisplay", options.shouldOpenMessagePreview(this.link.type)); this.keepScrollPosition();