]> Untitled Git - lemmy-ui.git/commitdiff
Use match
authorAnon <makotech222@gmail.com>
Mon, 8 Aug 2022 21:41:07 +0000 (16:41 -0500)
committerAnon <makotech222@gmail.com>
Mon, 8 Aug 2022 21:41:07 +0000 (16:41 -0500)
src/shared/components/modlog.tsx

index e0674f8b8c8a0112d6b1f854395ef9928050aa91..a22c20b8f61415c533337b6c80bc53a747efff03 100644 (file)
@@ -581,14 +581,19 @@ export class Modlog extends Component<any, ModlogState> {
         ) : (
           <div>
             <h5>
-              {this.state.communityName.isSome() && (
-                <Link
-                  className="text-body"
-                  to={`/c/${this.state.communityName}`}
-                >
-                  /c/{this.state.communityName}{" "}
-                </Link>
-              )}
+            {
+              this.state.communityName.match({
+                some: name => (
+                  <Link
+                    className="text-body"
+                    to={`/c/${name}`}
+                  >
+                    /c/{name}{" "}
+                  </Link>
+                ),
+                none: <></>,
+              })
+            }
               <span>{i18n.t("modlog")}</span>
             </h5>
             <form className="form-inline mr-2">