Temp bans (#524)

* Updating translations.

* Adding temp bans.

* Using new lemmy-js-client with temp bans

* Fixing some lint and dep issues
This commit is contained in:
Dessalines 2022-01-09 12:53:11 -05:00 committed by GitHub
parent 9abe811021
commit 4915193ae5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 1362 additions and 2006 deletions

View file

@ -896,19 +896,6 @@ export class Home extends Component<any, HomeState> {
this.setState(this.state);
} else if (op == UserOperation.BanPerson) {
let data = wsJsonToRes<BanPersonResponse>(msg).data;
let found = this.state.siteRes.banned.find(
p => (p.person.id = data.person_view.person.id)
);
// Remove the banned if its found in the list, and the action is an unban
if (found && !data.banned) {
this.state.siteRes.banned = this.state.siteRes.banned.filter(
i => i.person.id !== data.person_view.person.id
);
} else {
this.state.siteRes.banned.push(data.person_view);
}
this.state.posts
.filter(p => p.creator.id == data.person_view.person.id)
.forEach(p => (p.creator.banned = data.banned));