Skip to content

Commit

Permalink
updated logic for filterd downvoted waves
Browse files Browse the repository at this point in the history
  • Loading branch information
noumantahir committed May 27, 2024
1 parent cac24f6 commit 1688809
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 1688809

Please sign in to comment.