From 081e87209bc98c66d21502e89bc62f61c22fc982 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 29 Jun 2021 18:38:38 +0200 Subject: [PATCH] Fix pictures without metadata information in post display Signed-off-by: Thomas Citharel --- js/src/components/Image/LazyImageWrapper.vue | 2 +- js/src/views/Posts/Post.vue | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/js/src/components/Image/LazyImageWrapper.vue b/js/src/components/Image/LazyImageWrapper.vue index 2c6f8a544..af5b43493 100644 --- a/js/src/components/Image/LazyImageWrapper.vue +++ b/js/src/components/Image/LazyImageWrapper.vue @@ -32,7 +32,7 @@ const DEFAULT_PICTURE = { }) export default class LazyImageWrapper extends Vue { @Prop({ required: true }) - picture!: IMedia; + picture!: IMedia | null; get pictureOrDefault(): Partial { if (this.picture === null) { diff --git a/js/src/views/Posts/Post.vue b/js/src/views/Posts/Post.vue index 04a388192..bd83c47c3 100644 --- a/js/src/views/Posts/Post.vue +++ b/js/src/views/Posts/Post.vue @@ -2,13 +2,7 @@
@@ -87,7 +81,7 @@ import { IPost } from "../../types/post.model"; import { usernameWithDomain } from "../../types/actor"; import RouteName from "../../router/name"; import Tag from "../../components/Tag.vue"; -import LazyImage from "../../components/Image/LazyImage.vue"; +import LazyImageWrapper from "../../components/Image/LazyImageWrapper.vue"; import ActorInline from "../../components/Account/ActorInline.vue"; @Component({ @@ -124,7 +118,7 @@ import ActorInline from "../../components/Account/ActorInline.vue"; }, components: { Tag, - LazyImage, + LazyImageWrapper, ActorInline, }, metaInfo() {