From 40d9f12f79b8200b229552d27e0bf2beb3b270bc Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Fri, 4 Aug 2017 13:47:37 -0700 Subject: [PATCH] add parameter to exclude deleted posts when fetching, issue #37 and #35 --- src/pages/stream/stream.ts | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/pages/stream/stream.ts b/src/pages/stream/stream.ts index 1668a91..7b8ee83 100644 --- a/src/pages/stream/stream.ts +++ b/src/pages/stream/stream.ts @@ -87,7 +87,13 @@ export class StreamPage { } fetchOlderPosts(infiniteScroll) { - let params = {include_raw: 1, include_reposted_by:1, before_id: this.before_id, count: 40}; + let params = { + include_deleted: 0, + include_raw: 1, + include_reposted_by:1, + before_id: this.before_id, + count: 40 + }; if (this.title === 'Mentions') { this.fcaller = this.fetcher('me', params); } else { @@ -107,7 +113,13 @@ export class StreamPage { } fetchNewerPosts(refresher) { - let params = {include_raw: 1, include_reposted_by: 1, since_id: this.since_id, count: 40}; + let params = { + include_deleted: 0, + include_raw: 1, + include_reposted_by: 1, + since_id: this.since_id, + count: 40 + }; if (this.title === 'Mentions') { this.fcaller = this.fetcher('me', params); } else { @@ -127,7 +139,13 @@ export class StreamPage { } fetchPosts() { - this.fetcher({include_raw: 1, include_reposted_by: 1, count: 40}).then(res => { + let params = { + include_deleted: 0, + include_raw: 1, + include_reposted_by: 1, + count: 40 + }; + this.fetcher(params).then(res => { this.posts = this.parseData(res.data); this.since_id = res.meta.max_id; this.before_id = res.meta.min_id; @@ -165,7 +183,7 @@ export class StreamPage { } fetchThread(threadid) { - pnut.thread(threadid, {include_raw: 1, count: 140}).then(res => { + pnut.thread(threadid, {include_deleted: 0, include_raw: 1, count: 140}).then(res => { this.navCtrl.push(ThreadPage, {posts: res.data}); }).catch(err => { console.log(err);