Skip to content

Commit

Permalink
Merge pull request #2881 from ecency/nt/waves-rshare-filter
Browse files Browse the repository at this point in the history
updated logic for filterd downvoted waves
  • Loading branch information
feruzm authored May 27, 2024
2 parents 135f6b0 + 1688809 commit d77856a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/providers/queries/postQueries/wavesQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,23 @@ export const useWavesQuery = (host: string) => {
const _data = unionBy(...wavesQueries.map((query) => query.data), 'url');

const _filteredData = useMemo(
() => _data.filter((post) => (isArray(mutes) ? mutes.indexOf(post?.author) < 0 : true)),

() => _data.filter((post) =>
{
let _status = true;
//discard wave if author is muted
if (isArray(mutes) && mutes.indexOf(post?.author) > 0) {
_status = false;
}

//discard if wave is downvoted or marked gray
else if (post.net_rshares < 0 || post.stats?.gray || post.stats.hide) {
_status = false
}

return _status
}),
// (isArray(mutes) ? mutes.indexOf(post?.author) < 0 : true)),
[mutes, _data],
);

Expand Down

0 comments on commit d77856a

Please sign in to comment.