Reset canDisplay on previews on destroy

This commit is contained in:
Pavel Djundik 2018-07-13 23:03:36 +03:00 committed by Pavel Djundik
parent 4b5252d285
commit 7e5e031ea8

View File

@ -151,6 +151,11 @@ export default {
this.onPreviewUpdate(); 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: { methods: {
onPreviewUpdate() { onPreviewUpdate() {
// Error don't have any media to render // Error don't have any media to render
@ -165,7 +170,7 @@ export default {
}, },
onPreviewReady() { onPreviewReady() {
const options = require("../js/options"); 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(); this.keepScrollPosition();