From e5b3c518e22942cc18346357f7dac4cd7b978960 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 24 Sep 2018 13:41:56 +0300 Subject: [PATCH] Do not show toggle arrow if link data is still loading --- client/components/LinkPreview.vue | 10 +++++----- client/components/LinkPreviewToggle.vue | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/components/LinkPreview.vue b/client/components/LinkPreview.vue index bd3b0acd..965c5f75 100644 --- a/client/components/LinkPreview.vue +++ b/client/components/LinkPreview.vue @@ -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(); diff --git a/client/components/LinkPreviewToggle.vue b/client/components/LinkPreviewToggle.vue index 66a56b79..2d58d54f 100644 --- a/client/components/LinkPreviewToggle.vue +++ b/client/components/LinkPreviewToggle.vue @@ -1,5 +1,6 @@