]> Untitled Git - lemmy-ui.git/commitdiff
Fixing showLocal.
authorDessalines <tyhou13@gmx.com>
Mon, 1 Feb 2021 18:26:24 +0000 (13:26 -0500)
committerDessalines <tyhou13@gmx.com>
Mon, 1 Feb 2021 18:26:24 +0000 (13:26 -0500)
src/shared/components/main.tsx
src/shared/components/user.tsx

index 212a850d38603df7d6f2c03592cfc3121dec7670..b83d671298ff3696130dc500ae87fbeb5a1e6e32 100644 (file)
@@ -637,10 +637,7 @@ export class Main extends Component<any, MainState> {
   }
 
   get showLocal(): boolean {
-    return (
-      this.isoData.site_res.federated_instances !== null &&
-      this.isoData.site_res.federated_instances.linked.length > 0
-    );
+    return this.isoData.site_res.federated_instances?.linked.length > 0;
   }
 
   get canAdmin(): boolean {
index 92b50b6b914eae4f22bbdea9aa799d4264b3f748..43f872cea8719fc68f55699eab25fb6bea6f6e1a 100644 (file)
@@ -560,8 +560,7 @@ export class User extends Component<any, UserState> {
                     ]
                   }
                   showLocal={
-                    this.state.siteRes.federated_instances &&
-                    this.state.siteRes.federated_instances.length > 0
+                    this.state.siteRes.federated_instances?.linked.length > 0
                   }
                   onChange={this.handleUserSettingsListingTypeChange}
                 />