Display previews as they come in; fix image viewer
This commit is contained in:
parent
c6262a36e6
commit
5792bff49d
@ -124,10 +124,8 @@ export default {
|
||||
link: Object,
|
||||
},
|
||||
mounted() {
|
||||
if (this.link.shown) {
|
||||
const options = require("../js/options");
|
||||
this.$set(this.link, "canDisplay", options.shouldOpenMessagePreview(this.link.type));
|
||||
}
|
||||
const options = require("../js/options");
|
||||
this.$set(this.link, "canDisplay", this.link.type !== "loading" && options.shouldOpenMessagePreview(this.link.type));
|
||||
},
|
||||
methods: {
|
||||
onPreviewReady() {
|
||||
|
@ -60,6 +60,9 @@ export default {
|
||||
return "message-" + this.message.type;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
require("../js/renderPreview");
|
||||
},
|
||||
methods: {
|
||||
isAction() {
|
||||
return typeof MessageTypes["message-" + this.message.type] !== "undefined";
|
||||
|
@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
const socket = require("../socket");
|
||||
const {shouldOpenMessagePreview} = require("../options");
|
||||
const {vueApp, findChannel} = require("../vue");
|
||||
|
||||
socket.on("msg:preview", function(data) {
|
||||
@ -14,6 +15,8 @@ socket.on("msg:preview", function(data) {
|
||||
const previewIndex = message.previews.findIndex((m) => m.link === data.preview.link);
|
||||
|
||||
if (previewIndex > -1) {
|
||||
data.preview.canDisplay = shouldOpenMessagePreview(data.preview.type);
|
||||
|
||||
vueApp.$set(message.previews, previewIndex, data.preview);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user