add parameter to exclude deleted posts when fetching, issue #37 and #35

This commit is contained in:
Morgan McMillian 2017-08-04 13:47:37 -07:00
parent b11ea8e215
commit 40d9f12f79

View file

@ -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);