]> Untitled Git - lemmy-ui.git/commitdiff
Fix subscribe and block community buttons not showing up on first load
authorSleeplessOne1917 <abias1122@gmail.com>
Tue, 27 Jun 2023 23:01:47 +0000 (19:01 -0400)
committerSleeplessOne1917 <abias1122@gmail.com>
Tue, 27 Jun 2023 23:01:47 +0000 (19:01 -0400)
src/shared/components/community/sidebar.tsx

index 733c19a12db6e8b7c1b57eb8047111c143167b9c..d5cf2cb65c5bed9c4992fcb2c67f3ccbe76d8989 100644 (file)
@@ -260,20 +260,18 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
   subscribe() {
     const community_view = this.props.community_view;
     return (
-      <>
-        {community_view.subscribed == "NotSubscribed" && (
-          <button
-            className="btn btn-secondary d-block mb-2 w-100"
-            onClick={linkEvent(this, this.handleFollowCommunity)}
-          >
-            {this.state.followCommunityLoading ? (
-              <Spinner />
-            ) : (
-              I18NextService.i18n.t("subscribe")
-            )}
-          </button>
-        )}
-      </>
+      community_view.subscribed === "NotSubscribed" && (
+        <button
+          className="btn btn-secondary d-block mb-2 w-100"
+          onClick={linkEvent(this, this.handleFollowCommunity)}
+        >
+          {this.state.followCommunityLoading ? (
+            <Spinner />
+          ) : (
+            I18NextService.i18n.t("subscribe")
+          )}
+        </button>
+      )
     );
   }
 
@@ -281,18 +279,16 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
     const { subscribed, blocked } = this.props.community_view;
 
     return (
-      <>
-        {subscribed == "NotSubscribed" && (
-          <button
-            className="btn btn-danger d-block mb-2 w-100"
-            onClick={linkEvent(this, this.handleBlockCommunity)}
-          >
-            {I18NextService.i18n.t(
-              blocked ? "unblock_community" : "block_community"
-            )}
-          </button>
-        )}
-      </>
+      subscribed === "NotSubscribed" && (
+        <button
+          className="btn btn-danger d-block mb-2 w-100"
+          onClick={linkEvent(this, this.handleBlockCommunity)}
+        >
+          {I18NextService.i18n.t(
+            blocked ? "unblock_community" : "block_community"
+          )}
+        </button>
+      )
     );
   }