Merge branch 'use-post-image-wrapper' into 'master'
Fix pictures without metadata information in post display Closes #744 See merge request framasoft/mobilizon!968
This commit is contained in:
commit
cc806265cc
|
@ -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 a new issue