Fix pictures without metadata information in post display
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
2c4af0d267
commit
081e87209b
@ -32,7 +32,7 @@ const DEFAULT_PICTURE = {
|
||||
})
|
||||
export default class LazyImageWrapper extends Vue {
|
||||
@Prop({ required: true })
|
||||
picture!: IMedia;
|
||||
picture!: IMedia | null;
|
||||
|
||||
get pictureOrDefault(): Partial<IMedia> {
|
||||
if (this.picture === null) {
|
||||
|
@ -2,13 +2,7 @@
|
||||
<article class="container" v-if="post">
|
||||
<header>
|
||||
<div class="banner-container">
|
||||
<lazy-image
|
||||
v-if="post.picture"
|
||||
:src="post.picture.url"
|
||||
:width="post.picture.metadata.width"
|
||||
:height="post.picture.metadata.height"
|
||||
:blurhash="post.picture.metadata.blurhash"
|
||||
/>
|
||||
<lazy-image-wrapper :picture="post.picture" />
|
||||
</div>
|
||||
<div class="heading-section">
|
||||
<div class="heading-wrapper">
|
||||
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user