mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 20:31:37 +03:00
upadted promote posts
This commit is contained in:
parent
d17341a6a7
commit
89fce0e61f
@ -203,25 +203,18 @@ class PostsView extends Component {
|
||||
setFeedPosts(_posts);
|
||||
}
|
||||
|
||||
if (refreshing) {
|
||||
_posts = _posts.filter(item => !item.is_promoted);
|
||||
}
|
||||
|
||||
if (promotedPosts && promotedPosts.length > 0) {
|
||||
promotedPosts.forEach((promotedItem, i) => {
|
||||
if (get(_posts, [(i + 1) * 3], {}).permlink !== promotedItem.permlink) {
|
||||
_posts.splice((i + 1) * 3, i * 3, promotedItem);
|
||||
if (_posts[i * 3]) _posts.splice((i + 1) * 3, i * 3, promotedItem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// if (promotedPosts && promotedPosts.length > 0) {
|
||||
// if (refreshing) {
|
||||
// _posts = _posts.filter((item, i) => !item.is_promoted);
|
||||
// promotedPosts.forEach((promotedItem, i) => {
|
||||
// _posts.splice((i + 1) * 3, i * 3, promotedItem);
|
||||
// });
|
||||
// } else if (_posts.length < 11) {
|
||||
// _posts.push(promotedPosts[_posts.length % 3]);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (refreshing) {
|
||||
this.setState({
|
||||
posts: _posts,
|
||||
|
Loading…
Reference in New Issue
Block a user