mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge pull request #2481 from Human-Connection/fix_cannot_read_post_of_undefined
Fix `Cannot read 'Post' of undefined`
This commit is contained in:
commit
032242ac7c
@ -157,10 +157,11 @@ export default {
|
|||||||
$state.complete()
|
$state.complete()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { Post = [] } = previousResult
|
||||||
const result = {
|
const result = {
|
||||||
...previousResult,
|
...previousResult,
|
||||||
Post: [
|
Post: [
|
||||||
...previousResult.Post.filter(prevPost => {
|
...Post.filter(prevPost => {
|
||||||
return (
|
return (
|
||||||
fetchMoreResult.Post.filter(newPost => newPost.id === prevPost.id).length === 0
|
fetchMoreResult.Post.filter(newPost => newPost.id === prevPost.id).length === 0
|
||||||
)
|
)
|
||||||
|
|||||||
@ -390,10 +390,11 @@ export default {
|
|||||||
this.hasMore = false
|
this.hasMore = false
|
||||||
$state.complete()
|
$state.complete()
|
||||||
}
|
}
|
||||||
|
const { profilePagePosts = [] } = previousResult
|
||||||
const result = {
|
const result = {
|
||||||
...previousResult,
|
...previousResult,
|
||||||
profilePagePosts: [
|
profilePagePosts: [
|
||||||
...previousResult.profilePagePosts.filter(prevPost => {
|
...profilePagePosts.filter(prevPost => {
|
||||||
return (
|
return (
|
||||||
fetchMoreResult.profilePagePosts.filter(newPost => newPost.id === prevPost.id)
|
fetchMoreResult.profilePagePosts.filter(newPost => newPost.id === prevPost.id)
|
||||||
.length === 0
|
.length === 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user