Fix link expand buttons not showing if auto-expand option is off
This commit is contained in:
parent
7d7005c8af
commit
05303e4cf1
@ -141,6 +141,10 @@ export default {
|
||||
this.onPreviewUpdate();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
const shouldOpenByDefault = this.link.type === "link" ? this.$root.settings.links : this.$root.settings.media;
|
||||
this.link.shown = this.link.shown && shouldOpenByDefault;
|
||||
},
|
||||
mounted() {
|
||||
// Don't display previews while they are loading on the server
|
||||
if (this.link.type === "loading") {
|
||||
@ -172,8 +176,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onPreviewReady() {
|
||||
const options = require("../js/options");
|
||||
this.$set(this.link, "canDisplay", options.shouldOpenMessagePreview(this.link.type));
|
||||
this.$set(this.link, "canDisplay", true);
|
||||
|
||||
this.keepScrollPosition();
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<button
|
||||
v-if="link.canDisplay"
|
||||
:class="['toggle-button', 'toggle-preview', { opened: link.shown }]"
|
||||
@click="onClick" />
|
||||
</template>
|
||||
|
@ -64,16 +64,11 @@ module.exports = {
|
||||
initialized: false,
|
||||
highlightsRE: null,
|
||||
settings,
|
||||
shouldOpenMessagePreview,
|
||||
syncAllSettings,
|
||||
processSetting,
|
||||
initialize,
|
||||
};
|
||||
|
||||
function shouldOpenMessagePreview(type) {
|
||||
return type === "link" ? settings.links : settings.media;
|
||||
}
|
||||
|
||||
// Updates the checkbox and warning in settings.
|
||||
// When notifications are not supported, this is never called (because
|
||||
// checkbox state can not be changed).
|
||||
|
Loading…
Reference in New Issue
Block a user