Do not show toggle arrow if link data is still loading

This commit is contained in:
Pavel Djundik 2018-09-24 13:41:56 +03:00
parent 05303e4cf1
commit e5b3c518e2
2 changed files with 6 additions and 5 deletions

View File

@ -146,11 +146,6 @@ export default {
this.link.shown = this.link.shown && shouldOpenByDefault;
},
mounted() {
// Don't display previews while they are loading on the server
if (this.link.type === "loading") {
return;
}
this.$root.$on("resize", this.handleResize);
this.onPreviewUpdate();
@ -165,6 +160,11 @@ export default {
},
methods: {
onPreviewUpdate() {
// Don't display previews while they are loading on the server
if (this.link.type === "loading") {
return;
}
// Error don't have any media to render
if (this.link.type === "error") {
this.onPreviewReady();

View File

@ -1,5 +1,6 @@
<template>
<button
v-if="link.type !== 'loading'"
:class="['toggle-button', 'toggle-preview', { opened: link.shown }]"
@click="onClick" />
</template>