Add toggle to hide posts mentioning blocked users #78

Merged
floatingghost merged 1 commits from nbsp/pleroma-fe:hide-blocked-threads into develop 2022-07-31 21:47:25 +00:00
Contributor
      // XXX: doesn't work on domain blocks, because users from blocked domains
      // don't appear in `attentions' and therefore cannot be filtered.

even when not hidden, this tags those posts as filtered, like wordfiltered or muted user posts.

``` // XXX: doesn't work on domain blocks, because users from blocked domains // don't appear in `attentions' and therefore cannot be filtered. ``` even when not hidden, this tags those posts as filtered, like wordfiltered or muted user posts.

pretty poggers, that was quick

you've got a conflict in i18n stuff - and if i could be a bother ,the i18n key is a little ambiguous - maybe hideThreadWithBlockedUsers would be more descriptive

pretty poggers, that was quick you've got a conflict in i18n stuff - and if i could be a bother ,the i18n key is a little ambiguous - maybe `hideThreadWithBlockedUsers` would be more descriptive
Author
Contributor

that key is ambiguous, yeah, i think so too, but it's in line with other keys, like

        "hide_muted_posts": "Hide posts of muted users",

this is a REALLY bad key name but it is a precedent

that key is ambiguous, yeah, i think so too, but it's in line with other keys, like ```js "hide_muted_posts": "Hide posts of muted users", ``` this is a REALLY bad key name but it is a precedent

we have total control of this now, we can fix bad precedent :smug:

we have total control of this now, we can fix bad precedent :smug:
nbsp force-pushed hide-blocked-threads from 38cea74a0a to 669c583f37 2022-07-30 13:10:14 +00:00 Compare
Author
Contributor

yeah that's fair

yeah that's fair
floatingghost reviewed 2022-07-30 18:27:49 +00:00
floatingghost left a comment
Owner

just noticed one additional little thing, the rest looks good

just noticed one additional little thing, the rest looks good
@ -264,0 +267,4 @@
let mentions = false
// find if user in mentions list is blocked
this.status.attentions.forEach((attn) => {

whilst this works, you could also do

return this.status.find((attn) => {
  if (attn.id === this.currentUser.id) return false;
  const relationship = this.$store.getters.relationship(attn.id)
  if (relationship.blocking) {
    return true;
  }
  return false;
}) !== undefined;

which avoids the mutating boolean thing you've got going on there

whilst this works, you could also do ```js return this.status.find((attn) => { if (attn.id === this.currentUser.id) return false; const relationship = this.$store.getters.relationship(attn.id) if (relationship.blocking) { return true; } return false; }) !== undefined; ``` which avoids the mutating boolean thing you've got going on there
Author
Contributor

this is clever but i think it's less immediately readable this way

this is clever but i think it's less immediately readable this way

but your choice if you want to change here, lemme know either way since it looks okie~

but your choice if you want to change here, lemme know either way since it looks okie~

in that case, cool

thankies

in that case, cool thankies
floatingghost merged commit 7c675f1ded into develop 2022-07-31 21:47:25 +00:00
nbsp deleted branch hide-blocked-threads 2022-07-31 22:41:11 +00:00
Sign in to join this conversation.
No description provided.