Fix feedback on banning an unbanning
authorPascal de Vink <pascal@pascaldevink.nl>
Mon, 26 Jun 2023 20:45:56 +0000 (21:45 +0100)
committerJay Sitter <jay@jaysitter.com>
Mon, 26 Jun 2023 22:30:31 +0000 (18:30 -0400)
 When banning or unbanning, the API call was done, but updating the
frontend failed. This caused a confusing experience for an admin, until
the page was reloaded.

src/shared/components/person/profile.tsx

index 714b6bedcc2e5bd501afe93da99a424496b8afd1..622e9312555d39060cf628f121f5388edf21f03c 100644 (file)
@@ -205,6 +205,7 @@ export class Profile extends Component<
     this.handleSavePost = this.handleSavePost.bind(this);
     this.handlePurgePost = this.handlePurgePost.bind(this);
     this.handleFeaturePost = this.handleFeaturePost.bind(this);
+    this.handleModBanSubmit = this.handleModBanSubmit.bind(this);
 
     // Only fetch the data if coming from another route
     if (FirstLoadService.isFirstLoad) {
@@ -987,6 +988,7 @@ export class Profile extends Component<
           s.personRes.data.comments
             .filter(c => c.creator.id == banRes.data.person_view.person.id)
             .forEach(c => (c.creator.banned = banRes.data.banned));
+          s.personRes.data.person_view.person.banned = banRes.data.banned;
         }
         return s;
       });