Skip to content

Commit c66d46e

Browse files
authored
removed posts that have been deleted after reposted from feed (#367)
1 parent 752603a commit c66d46e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/pages/home/index.vue

+8
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ export default Vue.extend({
146146
const posts = await getPosts({}, id, payload)
147147
this.currentOffset += this.limit
148148
this.isLoading = false
149+
// Remove deleted reposts
150+
if (alg === `FOLLOWING`) {
151+
posts.forEach((post: IRepostResponse | any) => {
152+
if (post.deleted) {
153+
posts.splice(posts.indexOf(post), 1)
154+
}
155+
})
156+
}
149157
// End of unauth functions
150158
if (id === `x`) {
151159
return posts

src/pages/id/_id/reposts.vue

+6
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ export default Vue.extend({
9191
{ authorID: this.$route.params.id },
9292
{ sort: this.algorithm, offset: this.currentOffset, limit: this.limit },
9393
)
94+
// Remove deleted reposts
95+
res.forEach((post: IRepostResponse | any) => {
96+
if (post.deleted) {
97+
res.splice(res.indexOf(post), 1)
98+
}
99+
})
94100
if (res.length < this.limit) {
95101
const container = this.$parent.$refs.scrollContainer as HTMLElement
96102
container.removeEventListener(`scroll`, this.handleScroll)

0 commit comments

Comments
 (0)