Skip to content

Commit

Permalink
feat: get post domain from saved post attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jun 25, 2021
1 parent d179e87 commit 9d007d2
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions components/pages/posts/post/DynamicPostScroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<DynamicScrollerItem :item="item" :active="active" :data-index="index">
<!-- -->
<Post
:key="`${postsDomain}-${item.id}`"
:key="`${getPostDomain(item)}-${item.id}`"
:postData="item"
:postDomain="postsDomain"
:postDomain="getPostDomain(item)"
:viewOnly="viewOnly"
/>
</DynamicScrollerItem>
Expand All @@ -30,7 +30,7 @@ export default {
postsDomain: {
type: String,
required: true,
default: undefined,
},
viewOnly: {
Expand All @@ -44,6 +44,17 @@ export default {
return window.screen.availHeight * 1.5
},
},
methods: {
getPostDomain(post) {
// If domain is not assigned directly, load it from the `_saved_post_metadata` attribute on the `posts` prop
if (this.postsDomain === '<All Boorus>') {
return post['_saved_post_meta_data'].booru_domain
}
return this.postsDomain
},
},
}
</script>

Expand Down

0 comments on commit 9d007d2

Please sign in to comment.