]> Untitled Git - lemmy-ui.git/commitdiff
Adding Community Language fixes. #783 (#868)
authorDessalines <dessalines@users.noreply.github.com>
Mon, 19 Dec 2022 15:57:29 +0000 (10:57 -0500)
committerGitHub <noreply@github.com>
Mon, 19 Dec 2022 15:57:29 +0000 (10:57 -0500)
* Partially done with language tagging. #783

* A few more updates.

33 files changed:
.prettierrc.js [deleted file]
.prettierrc.json [new file with mode: 0644]
lemmy-translations
package.json
src/assets/css/main.css
src/shared/components/comment/comment-form.tsx
src/shared/components/comment/comment-node.tsx
src/shared/components/comment/comment-nodes.tsx
src/shared/components/comment/comment-report.tsx
src/shared/components/common/language-select.tsx
src/shared/components/common/markdown-textarea.tsx
src/shared/components/common/registration-application.tsx
src/shared/components/community/community-form.tsx
src/shared/components/community/community.tsx
src/shared/components/community/create-community.tsx
src/shared/components/community/sidebar.tsx
src/shared/components/home/home.tsx
src/shared/components/home/signup.tsx
src/shared/components/home/site-form.tsx
src/shared/components/person/inbox.tsx
src/shared/components/person/person-details.tsx
src/shared/components/person/profile.tsx
src/shared/components/person/settings.tsx
src/shared/components/post/create-post.tsx
src/shared/components/post/post-form.tsx
src/shared/components/post/post-listing.tsx
src/shared/components/post/post-listings.tsx
src/shared/components/post/post-report.tsx
src/shared/components/post/post.tsx
src/shared/components/private_message/private-message-form.tsx
src/shared/components/search.tsx
src/shared/utils.ts
yarn.lock

diff --git a/.prettierrc.js b/.prettierrc.js
deleted file mode 100644 (file)
index 8d36af3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = Object.assign(require("eslint-plugin-prettier"), {
-  arrowParens: "avoid",
-  semi: true,
-});
diff --git a/.prettierrc.json b/.prettierrc.json
new file mode 100644 (file)
index 0000000..15bc4fe
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "arrowParens": "avoid",
+  "semi": true
+}
index a2f59fcbf7529a1f7dd5cda894381ef2000b9ef5..c97005696d132acf2cad3506df4f3c2256142349 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a2f59fcbf7529a1f7dd5cda894381ef2000b9ef5
+Subproject commit c97005696d132acf2cad3506df4f3c2256142349
index 002db3f5d2d984b4f433e6f911126ffbcf611b2b..9d144465279a0f524db419f0d1d52f8b97580e6e 100644 (file)
@@ -9,7 +9,7 @@
     "build:prod": "webpack --mode=production",
     "clean": "yarn run rimraf dist",
     "dev": "yarn start",
-    "lint": "node generate_translations.js && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src",
+    "lint": "node generate_translations.js && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check 'src/**/*.tsx'",
     "prebuild:dev": "yarn clean && node generate_translations.js",
     "prebuild:prod": "yarn clean && node generate_translations.js",
     "prepare": "husky install",
     "express": "~4.18.1",
     "html-to-text": "^8.2.1",
     "i18next": "^21.8.14",
-    "inferno": "^8.0.3",
-    "inferno-create-element": "^8.0.3",
+    "inferno": "^8.0.5",
+    "inferno-create-element": "^8.0.5",
     "inferno-helmet": "^5.2.1",
-    "inferno-hydrate": "^8.0.3",
+    "inferno-hydrate": "^8.0.5",
     "inferno-i18next-dess": "0.0.2",
-    "inferno-router": "^8.0.3",
-    "inferno-server": "^8.0.3",
+    "inferno-router": "^8.0.5",
+    "inferno-server": "^8.0.5",
     "isomorphic-cookie": "^1.2.4",
     "jwt-decode": "^3.1.2",
-    "lemmy-js-client": "0.17.0-rc.56",
+    "lemmy-js-client": "0.17.0-rc.57",
     "markdown-it": "^13.0.1",
     "markdown-it-container": "^3.0.0",
     "markdown-it-footnote": "^3.0.3",
index a2a2a65cc9286950b3a38f058c1af21bc29cb09b..98e98d26776d21c1398e8f83702ade445b3ae762 100644 (file)
@@ -385,4 +385,12 @@ br.big {
   display: -webkit-box;
   -webkit-line-clamp: 3;
   -webkit-box-orient: vertical;
-}
\ No newline at end of file
+}
+
+.lang-select-action {
+  width: 100px;
+}
+
+.lang-select-action:focus {
+  width: auto;
+}
index d9630fda0759ebd88eee6111cd36104d760dca63..a74cc8be1d96387bbbd43960cca59b34cd57f2e2 100644 (file)
@@ -35,6 +35,7 @@ interface CommentFormProps {
   focus?: boolean;
   onReplyCancel?(): any;
   allLanguages: Language[];
+  siteLanguages: number[];
 }
 
 interface CommentFormState {
@@ -81,7 +82,13 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
     let selectedLang = this.props.node
       .left()
       .map(n => n.comment_view.comment.language_id)
-      .or(myFirstDiscussionLanguageId(UserService.Instance.myUserInfo));
+      .or(
+        myFirstDiscussionLanguageId(
+          this.props.allLanguages,
+          this.props.siteLanguages,
+          UserService.Instance.myUserInfo
+        )
+      );
 
     return (
       <div className="mb-3">
@@ -100,6 +107,7 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
             onReplyCancel={this.handleReplyCancel}
             placeholder={Some(i18n.t("comment_here"))}
             allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
           />
         ) : (
           <div className="alert alert-warning" role="alert">
index 4555ff58a7b2b81eb683144ab78d0287d405bb0e..e37c68e799b0e01abc3559a5d53282eff326c8b4 100644 (file)
@@ -104,6 +104,7 @@ interface CommentNodeProps {
   enableDownvotes: boolean;
   viewType: CommentViewType;
   allLanguages: Language[];
+  siteLanguages: number[];
   hideImages?: boolean;
 }
 
@@ -329,6 +330,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
                 disabled={this.props.locked}
                 focus
                 allLanguages={this.props.allLanguages}
+                siteLanguages={this.props.siteLanguages}
               />
             )}
             {!this.state.showEdit && !this.state.collapsed && (
@@ -1015,6 +1017,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
             disabled={this.props.locked}
             focus
             allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
           />
         )}
         {!this.state.collapsed && node.children.length > 0 && (
@@ -1027,6 +1030,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
             enableDownvotes={this.props.enableDownvotes}
             viewType={this.props.viewType}
             allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
             hideImages={this.props.hideImages}
           />
         )}
index 5c1f2960526562191e942b1e6ed1eaf159ef7303..9072e72371192a8266a48888175c41b1fca1e637 100644 (file)
@@ -24,6 +24,7 @@ interface CommentNodesProps {
   enableDownvotes?: boolean;
   viewType: CommentViewType;
   allLanguages: Language[];
+  siteLanguages: number[];
   hideImages?: boolean;
 }
 
@@ -55,6 +56,7 @@ export class CommentNodes extends Component<CommentNodesProps, any> {
             enableDownvotes={this.props.enableDownvotes}
             viewType={this.props.viewType}
             allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
             hideImages={this.props.hideImages}
           />
         ))}
index b625b447b7f062b25071fffe81692693ecfcd0e1..b90eae41470d9d1d2850821cee974ebecde33b1c 100644 (file)
@@ -65,6 +65,7 @@ export class CommentReport extends Component<CommentReportProps, any> {
           viewOnly={true}
           showCommunity={true}
           allLanguages={[]}
+          siteLanguages={[]}
           hideImages
         />
         <div>
index 746fea4a188f8fee088db200b3d3d25f962e598f..c7da2f05b38769b283254ea704bd7214b9bbde4d 100644 (file)
@@ -3,14 +3,19 @@ import classNames from "classnames";
 import { Component, linkEvent } from "inferno";
 import { Language } from "lemmy-js-client";
 import { i18n } from "../../i18next";
-import { randomStr } from "../../utils";
+import { UserService } from "../../services/UserService";
+import { randomStr, selectableLanguages } from "../../utils";
 import { Icon } from "./icon";
 
 interface LanguageSelectProps {
   allLanguages: Language[];
+  siteLanguages: number[];
   selectedLanguageIds: Option<number[]>;
   multiple: boolean;
   onChange(val: number[]): any;
+  showAll?: boolean;
+  showSite?: boolean;
+  iconVersion?: boolean;
 }
 
 export class LanguageSelect extends Component<LanguageSelectProps, any> {
@@ -42,9 +47,9 @@ export class LanguageSelect extends Component<LanguageSelectProps, any> {
   }
 
   render() {
-    let selectedLangs = this.props.selectedLanguageIds;
-
-    return (
+    return this.props.iconVersion ? (
+      this.selectBtn
+    ) : (
       <div className="form-group row">
         <label
           className={classNames("col-form-label", {
@@ -61,23 +66,7 @@ export class LanguageSelect extends Component<LanguageSelectProps, any> {
             "col-sm-10": !this.props.multiple,
           })}
         >
-          <select
-            className="form-control custom-select"
-            id={this.id}
-            onChange={linkEvent(this, this.handleLanguageChange)}
-            aria-label="action"
-            multiple={this.props.multiple}
-          >
-            {this.props.allLanguages.map(l => (
-              <option
-                key={l.id}
-                value={l.id}
-                selected={selectedLangs.unwrapOr([]).includes(l.id)}
-              >
-                {l.name}
-              </option>
-            ))}
-          </select>
+          {this.selectBtn}
           {this.props.multiple && (
             <div className="input-group-append">
               <button
@@ -93,6 +82,40 @@ export class LanguageSelect extends Component<LanguageSelectProps, any> {
     );
   }
 
+  get selectBtn() {
+    let selectedLangs = this.props.selectedLanguageIds;
+    let filteredLangs = selectableLanguages(
+      this.props.allLanguages,
+      this.props.siteLanguages,
+      this.props.showAll,
+      this.props.showSite,
+      UserService.Instance.myUserInfo
+    );
+
+    return (
+      <select
+        className={classNames("lang-select-action", {
+          "form-control custom-select": !this.props.iconVersion,
+          "btn btn-sm text-muted": this.props.iconVersion,
+        })}
+        id={this.id}
+        onChange={linkEvent(this, this.handleLanguageChange)}
+        aria-label="action"
+        multiple={this.props.multiple}
+      >
+        {filteredLangs.map(l => (
+          <option
+            key={l.id}
+            value={l.id}
+            selected={selectedLangs.unwrapOr([]).includes(l.id)}
+          >
+            {l.name}
+          </option>
+        ))}
+      </select>
+    );
+  }
+
   handleLanguageChange(i: LanguageSelect, event: any) {
     let options: HTMLOptionElement[] = Array.from(event.target.options);
     let selected: number[] = options
index d58520fe7182612e1148cb55095786dc1ad7377b..6b517d7749a03329c6ed68252f34d173602ee690 100644 (file)
@@ -41,6 +41,7 @@ interface MarkdownTextAreaProps {
     languageId: Option<number>;
   }): any;
   allLanguages: Language[];
+  siteLanguages: number[];
 }
 
 interface MarkdownTextAreaState {
@@ -164,18 +165,6 @@ export class MarkdownTextArea extends Component<
             {i18n.t("body")}
           </label>
         </div>
-        {this.props.showLanguage && (
-          <div className="row justify-content-end">
-            <div className="col-sm-8">
-              <LanguageSelect
-                allLanguages={this.props.allLanguages}
-                selectedLanguageIds={this.state.languageId.map(Array.of)}
-                multiple={false}
-                onChange={this.handleLanguageChange}
-              />
-            </div>
-          </div>
-        )}
         <div className="row">
           <div className="col-sm-12 d-flex flex-wrap">
             {this.props.buttonTitle.match({
@@ -215,6 +204,17 @@ export class MarkdownTextArea extends Component<
             )}
             {/* A flex expander */}
             <div className="flex-grow-1"></div>
+
+            {this.props.showLanguage && (
+              <LanguageSelect
+                iconVersion
+                allLanguages={this.props.allLanguages}
+                selectedLanguageIds={this.state.languageId.map(Array.of)}
+                siteLanguages={this.props.siteLanguages}
+                multiple={false}
+                onChange={this.handleLanguageChange}
+              />
+            )}
             <button
               className="btn btn-sm text-muted"
               data-tippy-content={i18n.t("bold")}
index 07fbf203926ebbd8aac31e112d5ac4b531a6afde..050fe9613f1f91fc1f2cbe3dd82c670010dac00b 100644 (file)
@@ -102,6 +102,7 @@ export class RegistrationApplication extends Component<
                 maxLength={None}
                 hideNavigationWarnings
                 allLanguages={[]}
+                siteLanguages={[]}
               />
             </div>
           </div>
index db7cff08a508e3644fd1a04aad75b50c8813bb6f..805e49638c457f0adf73759d85a3a6d82e711504 100644 (file)
@@ -6,6 +6,7 @@ import {
   CommunityView,
   CreateCommunity,
   EditCommunity,
+  Language,
   toUndefined,
   UserOperation,
   wsJsonToRes,
@@ -23,10 +24,14 @@ import {
 } from "../../utils";
 import { Icon, Spinner } from "../common/icon";
 import { ImageUploadForm } from "../common/image-upload-form";
+import { LanguageSelect } from "../common/language-select";
 import { MarkdownTextArea } from "../common/markdown-textarea";
 
 interface CommunityFormProps {
   community_view: Option<CommunityView>; // If a community is given, that means this is an edit
+  allLanguages: Language[];
+  siteLanguages: number[];
+  communityLanguages: Option<number[]>;
   onCancel?(): any;
   onCreate?(community: CommunityView): any;
   onEdit?(community: CommunityView): any;
@@ -50,6 +55,7 @@ export class CommunityForm extends Component<
       name: undefined,
       title: undefined,
       description: None,
+      discussion_languages: this.props.communityLanguages,
       nsfw: None,
       icon: None,
       banner: None,
@@ -73,6 +79,9 @@ export class CommunityForm extends Component<
     this.handleBannerUpload = this.handleBannerUpload.bind(this);
     this.handleBannerRemove = this.handleBannerRemove.bind(this);
 
+    this.handleDiscussionLanguageChange =
+      this.handleDiscussionLanguageChange.bind(this);
+
     this.parseMessage = this.parseMessage.bind(this);
     this.subscription = wsSubscribe(this.parseMessage);
 
@@ -90,6 +99,7 @@ export class CommunityForm extends Component<
           posting_restricted_to_mods: Some(
             cv.community.posting_restricted_to_mods
           ),
+          discussion_languages: this.props.communityLanguages,
           auth: undefined,
         }),
       };
@@ -218,6 +228,7 @@ export class CommunityForm extends Component<
                 maxLength={None}
                 onContentChange={this.handleCommunityDescriptionChange}
                 allLanguages={[]}
+                siteLanguages={[]}
               />
             </div>
           </div>
@@ -261,6 +272,14 @@ export class CommunityForm extends Component<
               </div>
             </div>
           </div>
+          <LanguageSelect
+            allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
+            showSite
+            selectedLanguageIds={this.state.communityForm.discussion_languages}
+            multiple={true}
+            onChange={this.handleDiscussionLanguageChange}
+          />
           <div className="form-group row">
             <div className="col-12">
               <button
@@ -308,6 +327,7 @@ export class CommunityForm extends Component<
           banner: cForm.banner,
           nsfw: cForm.nsfw,
           posting_restricted_to_mods: cForm.posting_restricted_to_mods,
+          discussion_languages: cForm.discussion_languages,
           auth: cForm.auth,
         });
 
@@ -368,6 +388,10 @@ export class CommunityForm extends Component<
     this.setState(s => ((s.communityForm.banner = Some("")), s));
   }
 
+  handleDiscussionLanguageChange(val: number[]) {
+    this.setState(s => ((s.communityForm.discussion_languages = Some(val)), s));
+  }
+
   parseMessage(msg: any) {
     let op = wsUserOp(msg);
     console.log(msg);
index 77c01d62ad053559b6680390a91bde914388c86a..7ce6099988d9c9a866a3906532ea4e0fac3d88ba 100644 (file)
@@ -278,6 +278,16 @@ export class Community extends Component<any, State> {
   }
 
   render() {
+    // For some reason, this returns an empty vec if it matches the site langs
+    let communityLangs = this.state.communityRes.map(r => {
+      let langs = r.discussion_languages;
+      if (langs.length == 0) {
+        return this.state.siteRes.all_languages.map(l => l.id);
+      } else {
+        return langs;
+      }
+    });
+
     return (
       <div className="container-lg">
         {this.state.communityLoading ? (
@@ -321,6 +331,12 @@ export class Community extends Component<any, State> {
                             admins={this.state.siteRes.admins}
                             online={res.online}
                             enableNsfw={enableNsfw(this.state.siteRes)}
+                            editable
+                            allLanguages={this.state.siteRes.all_languages}
+                            siteLanguages={
+                              this.state.siteRes.discussion_languages
+                            }
+                            communityLanguages={communityLangs}
                           />
                           {!res.community_view.community.local &&
                             res.site.match({
@@ -352,6 +368,10 @@ export class Community extends Component<any, State> {
                       admins={this.state.siteRes.admins}
                       online={res.online}
                       enableNsfw={enableNsfw(this.state.siteRes)}
+                      editable
+                      allLanguages={this.state.siteRes.all_languages}
+                      siteLanguages={this.state.siteRes.discussion_languages}
+                      communityLanguages={communityLangs}
                     />
                     {!res.community_view.community.local &&
                       res.site.match({
@@ -390,6 +410,7 @@ export class Community extends Component<any, State> {
           enableDownvotes={enableDownvotes(this.state.siteRes)}
           enableNsfw={enableNsfw(this.state.siteRes)}
           allLanguages={this.state.siteRes.all_languages}
+          siteLanguages={this.state.siteRes.discussion_languages}
         />
       )
     ) : this.state.commentsLoading ? (
@@ -407,6 +428,7 @@ export class Community extends Component<any, State> {
         admins={Some(this.state.siteRes.admins)}
         maxCommentsShown={None}
         allLanguages={this.state.siteRes.all_languages}
+        siteLanguages={this.state.siteRes.discussion_languages}
       />
     );
   }
@@ -559,7 +581,10 @@ export class Community extends Component<any, State> {
     ) {
       let data = wsJsonToRes<CommunityResponse>(msg, CommunityResponse);
       this.state.communityRes.match({
-        some: res => (res.community_view = data.community_view),
+        some: res => {
+          res.community_view = data.community_view;
+          res.discussion_languages = data.discussion_languages;
+        },
         none: void 0,
       });
       this.setState(this.state);
index 5065665a8c59f1b18e326f321c8075669565ed17..5981a9f8aa8c38e3e31e63c0e75a41934aed41c2 100644 (file)
@@ -1,4 +1,4 @@
-import { None } from "@sniptt/monads";
+import { None, Some } from "@sniptt/monads";
 import { Component } from "inferno";
 import { CommunityView, GetSiteResponse } from "lemmy-js-client";
 import { Subscription } from "rxjs";
@@ -74,6 +74,11 @@ export class CreateCommunity extends Component<any, CreateCommunityState> {
                 community_view={None}
                 onCreate={this.handleCommunityCreate}
                 enableNsfw={enableNsfw(this.state.siteRes)}
+                allLanguages={this.state.siteRes.all_languages}
+                siteLanguages={this.state.siteRes.discussion_languages}
+                communityLanguages={Some(
+                  this.state.siteRes.discussion_languages
+                )}
               />
             </div>
           </div>
index 43e863c87c09172edee88aa640c51a0066c10d74..845ef9e444975183437761bc5cd25dc0ea532273 100644 (file)
@@ -8,6 +8,7 @@ import {
   CommunityView,
   DeleteCommunity,
   FollowCommunity,
+  Language,
   PersonViewSafe,
   PurgeCommunity,
   RemoveCommunity,
@@ -36,9 +37,13 @@ interface SidebarProps {
   community_view: CommunityView;
   moderators: CommunityModeratorView[];
   admins: PersonViewSafe[];
+  allLanguages: Language[];
+  siteLanguages: number[];
+  communityLanguages: Option<number[]>;
   online: number;
   enableNsfw?: boolean;
   showIcon?: boolean;
+  editable?: boolean;
 }
 
 interface SidebarState {
@@ -79,6 +84,9 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
         ) : (
           <CommunityForm
             community_view={Some(this.props.community_view)}
+            allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
+            communityLanguages={this.props.communityLanguages}
             onEdit={this.handleEditCommunity}
             onCancel={this.handleEditCancel}
             enableNsfw={this.props.enableNsfw}
@@ -94,7 +102,7 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
         <div className="card border-secondary mb-3">
           <div className="card-body">
             {this.communityTitle()}
-            {this.adminButtons()}
+            {this.props.editable && this.adminButtons()}
             {this.subscribe()}
             {this.canPost && this.createPost()}
             {this.blockCommunity()}
index 877837bef4ad3dc7371801e97d4777f3cd57ab42..2b51e8ed49744e7a9c5befe874b15f518c98c1c6 100644 (file)
@@ -589,6 +589,7 @@ export class Home extends Component<any, HomeState> {
         enableDownvotes={enableDownvotes(this.state.siteRes)}
         enableNsfw={enableNsfw(this.state.siteRes)}
         allLanguages={this.state.siteRes.all_languages}
+        siteLanguages={this.state.siteRes.discussion_languages}
       />
     ) : (
       <CommentNodes
@@ -602,6 +603,7 @@ export class Home extends Component<any, HomeState> {
         showContext
         enableDownvotes={enableDownvotes(this.state.siteRes)}
         allLanguages={this.state.siteRes.all_languages}
+        siteLanguages={this.state.siteRes.discussion_languages}
       />
     );
   }
index 2f6285033f620ae1cffa61c96116cf3d18645b87..7e35ecd65cea720800c8ff802e14d4f02d01d570 100644 (file)
@@ -297,6 +297,7 @@ export class Signup extends Component<any, State> {
                   onContentChange={this.handleAnswerChange}
                   hideNavigationWarnings
                   allLanguages={[]}
+                  siteLanguages={[]}
                 />
               </div>
             </div>
index 39a6312f7473dd96bbf3e4e66dfe3369720b2b50..58532b63be8f5418afbfb370ebfc797b1e03192f 100644 (file)
@@ -272,6 +272,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
                 onContentChange={this.handleSiteSidebarChange}
                 hideNavigationWarnings
                 allLanguages={[]}
+                siteLanguages={[]}
               />
             </div>
           </div>
@@ -289,6 +290,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
                 onContentChange={this.handleSiteLegalInfoChange}
                 hideNavigationWarnings
                 allLanguages={[]}
+                siteLanguages={[]}
               />
             </div>
           </div>
@@ -307,6 +309,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
                   onContentChange={this.handleSiteApplicationQuestionChange}
                   hideNavigationWarnings
                   allLanguages={[]}
+                  siteLanguages={[]}
                 />
               </div>
             </div>
@@ -568,9 +571,11 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
           </div>
           <LanguageSelect
             allLanguages={this.props.siteRes.all_languages}
+            siteLanguages={this.props.siteRes.discussion_languages}
             selectedLanguageIds={this.state.siteForm.discussion_languages}
             multiple={true}
             onChange={this.handleDiscussionLanguageChange}
+            showAll
           />
           <div className="form-group row">
             <label
@@ -981,62 +986,60 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
               />
             </div>
           </div>
-          {siteSetup && (
-            <div className="form-group row">
-              <h5 className="col-12">{i18n.t("taglines")}</h5>
-              <div className="table-responsive col-12">
-                <table
-                  id="taglines_table"
-                  className="table table-sm table-hover"
-                >
-                  <thead className="pointer"></thead>
-                  <tbody>
-                    {this.state.siteForm.taglines
-                      .unwrapOr([])
-                      .map((cv, index) => (
-                        <tr key={index}>
-                          <td>
-                            <MarkdownTextArea
-                              initialContent={Some(cv)}
-                              initialLanguageId={None}
-                              placeholder={None}
-                              buttonTitle={None}
-                              maxLength={None}
-                              onContentChange={s =>
-                                this.handleTaglineChange(this, index, s)
-                              }
-                              hideNavigationWarnings
-                              allLanguages={this.props.siteRes.all_languages}
+          <div className="form-group row">
+            <h5 className="col-12">{i18n.t("taglines")}</h5>
+            <div className="table-responsive col-12">
+              <table id="taglines_table" className="table table-sm table-hover">
+                <thead className="pointer"></thead>
+                <tbody>
+                  {this.state.siteForm.taglines
+                    .unwrapOr([])
+                    .map((cv, index) => (
+                      <tr key={index}>
+                        <td>
+                          <MarkdownTextArea
+                            initialContent={Some(cv)}
+                            initialLanguageId={None}
+                            placeholder={None}
+                            buttonTitle={None}
+                            maxLength={None}
+                            onContentChange={s =>
+                              this.handleTaglineChange(this, index, s)
+                            }
+                            hideNavigationWarnings
+                            allLanguages={this.props.siteRes.all_languages}
+                            siteLanguages={
+                              this.props.siteRes.discussion_languages
+                            }
+                          />
+                        </td>
+                        <td className="text-right">
+                          <button
+                            className="btn btn-link btn-animate text-muted"
+                            onClick={e =>
+                              this.handleDeleteTaglineClick(this, index, e)
+                            }
+                            data-tippy-content={i18n.t("delete")}
+                            aria-label={i18n.t("delete")}
+                          >
+                            <Icon
+                              icon="trash"
+                              classes={`icon-inline text-danger`}
                             />
-                          </td>
-                          <td className="text-right">
-                            <button
-                              className="btn btn-link btn-animate text-muted"
-                              onClick={e =>
-                                this.handleDeleteTaglineClick(this, index, e)
-                              }
-                              data-tippy-content={i18n.t("delete")}
-                              aria-label={i18n.t("delete")}
-                            >
-                              <Icon
-                                icon="trash"
-                                classes={`icon-inline text-danger`}
-                              />
-                            </button>
-                          </td>
-                        </tr>
-                      ))}
-                  </tbody>
-                </table>
-                <button
-                  className="btn btn-sm btn-secondary mr-2"
-                  onClick={e => this.handleAddTaglineClick(this, e)}
-                >
-                  {i18n.t("add_tagline")}
-                </button>
-              </div>
+                          </button>
+                        </td>
+                      </tr>
+                    ))}
+                </tbody>
+              </table>
+              <button
+                className="btn btn-sm btn-secondary mr-2"
+                onClick={e => this.handleAddTaglineClick(this, e)}
+              >
+                {i18n.t("add_tagline")}
+              </button>
             </div>
-          )}
+          </div>
           <div className="form-group row">
             <div className="col-12">
               <button
@@ -1109,6 +1112,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
         allowed_instances: sForm.allowed_instances,
         blocked_instances: sForm.blocked_instances,
         discussion_languages: sForm.discussion_languages,
+        taglines: sForm.taglines,
       });
       WebSocketService.Instance.send(wsClient.createSite(form));
     }
index 40b2678e9544542780b3ba914d15f40c6240f7b9..00d8af80ec53db8085ccb84d850a86fbbd0239f7 100644 (file)
@@ -396,6 +396,7 @@ export class Inbox extends Component<any, InboxState> {
             showContext
             enableDownvotes={enableDownvotes(this.state.siteRes)}
             allLanguages={this.state.siteRes.all_languages}
+            siteLanguages={this.state.siteRes.discussion_languages}
           />
         );
       case ReplyEnum.Mention:
@@ -419,6 +420,7 @@ export class Inbox extends Component<any, InboxState> {
             showContext
             enableDownvotes={enableDownvotes(this.state.siteRes)}
             allLanguages={this.state.siteRes.all_languages}
+            siteLanguages={this.state.siteRes.discussion_languages}
           />
         );
       case ReplyEnum.Message:
@@ -452,6 +454,7 @@ export class Inbox extends Component<any, InboxState> {
           showContext
           enableDownvotes={enableDownvotes(this.state.siteRes)}
           allLanguages={this.state.siteRes.all_languages}
+          siteLanguages={this.state.siteRes.discussion_languages}
         />
       </div>
     );
@@ -474,6 +477,7 @@ export class Inbox extends Component<any, InboxState> {
             showContext
             enableDownvotes={enableDownvotes(this.state.siteRes)}
             allLanguages={this.state.siteRes.all_languages}
+            siteLanguages={this.state.siteRes.discussion_languages}
           />
         ))}
       </div>
index e228cbdf678a0bdfd8760195960f9279b8414c3a..f50b6d362a4d542137d9b9adec44ce73cad1c5d2 100644 (file)
@@ -18,6 +18,7 @@ interface PersonDetailsProps {
   personRes: GetPersonDetailsResponse;
   admins: PersonViewSafe[];
   allLanguages: Language[];
+  siteLanguages: number[];
   page: number;
   limit: number;
   sort: SortType;
@@ -102,6 +103,7 @@ export class PersonDetails extends Component<PersonDetailsProps, any> {
             showContext
             enableDownvotes={this.props.enableDownvotes}
             allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
           />
         );
       }
@@ -118,6 +120,7 @@ export class PersonDetails extends Component<PersonDetailsProps, any> {
             enableDownvotes={this.props.enableDownvotes}
             enableNsfw={this.props.enableNsfw}
             allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
           />
         );
       }
@@ -176,6 +179,7 @@ export class PersonDetails extends Component<PersonDetailsProps, any> {
           showContext
           enableDownvotes={this.props.enableDownvotes}
           allLanguages={this.props.allLanguages}
+          siteLanguages={this.props.siteLanguages}
         />
       </div>
     );
@@ -195,6 +199,7 @@ export class PersonDetails extends Component<PersonDetailsProps, any> {
               enableDownvotes={this.props.enableDownvotes}
               enableNsfw={this.props.enableNsfw}
               allLanguages={this.props.allLanguages}
+              siteLanguages={this.props.siteLanguages}
             />
             <hr className="my-3" />
           </>
index 986f9fd9ddab74eca1bec369e92d5dc1e860f0eb..47399843cab521e119195d8f15d02d9e1a2a8ad0 100644 (file)
@@ -279,6 +279,7 @@ export class Profile extends Component<any, ProfileState> {
                     view={this.state.view}
                     onPageChange={this.handlePageChange}
                     allLanguages={this.state.siteRes.all_languages}
+                    siteLanguages={this.state.siteRes.discussion_languages}
                   />
                 </div>
 
index 9c1e06ad0087e0e14cba14a38d2afc76157f8591..0f904d5e66805340ab39446f65f0cac0be13b605 100644 (file)
@@ -168,7 +168,7 @@ export class Settings extends Component<any, SettingsState> {
           default_sort_type: Some(luv.local_user.default_sort_type),
           default_listing_type: Some(luv.local_user.default_listing_type),
           interface_language: Some(luv.local_user.interface_language),
-          discussion_languages: Some(mui.discussion_languages.map(l => l.id)),
+          discussion_languages: Some(mui.discussion_languages),
           avatar: luv.person.avatar,
           banner: luv.person.banner,
           display_name: luv.person.display_name,
@@ -523,6 +523,7 @@ export class Settings extends Component<any, SettingsState> {
                 buttonTitle={None}
                 hideNavigationWarnings
                 allLanguages={this.state.siteRes.all_languages}
+                siteLanguages={this.state.siteRes.discussion_languages}
               />
             </div>
           </div>
@@ -617,8 +618,10 @@ export class Settings extends Component<any, SettingsState> {
           </div>
           <LanguageSelect
             allLanguages={this.state.siteRes.all_languages}
+            siteLanguages={this.state.siteRes.discussion_languages}
             selectedLanguageIds={selectedLangs}
             multiple={true}
+            showSite
             onChange={this.handleDiscussionLanguageChange}
           />
           <div className="form-group row">
index 6d4122cef4deafd069277ee5bab5b0ffb9ddf529..37c855f632051f013d6abcdf74b5c9488ebde557 100644 (file)
@@ -151,6 +151,7 @@ export class CreatePost extends Component<any, CreatePostState> {
                     enableDownvotes={enableDownvotes(this.state.siteRes)}
                     enableNsfw={enableNsfw(this.state.siteRes)}
                     allLanguages={this.state.siteRes.all_languages}
+                    siteLanguages={this.state.siteRes.discussion_languages}
                   />
                 </div>
               </div>
index 0f8ea0bbc11e068b1c95144a5d7213df0812aa75..abfb5430f19bf5df14788452d6872df4814f2835 100644 (file)
@@ -64,6 +64,7 @@ const MAX_POST_TITLE_LENGTH = 200;
 interface PostFormProps {
   post_view: Option<PostView>; // If a post is given, that means this is an edit
   allLanguages: Language[];
+  siteLanguages: number[];
   communities: Option<CommunityView[]>;
   params: Option<PostFormParams>;
   onCancel?(): any;
@@ -182,7 +183,13 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
 
   render() {
     let selectedLangs = this.state.postForm.language_id
-      .or(myFirstDiscussionLanguageId(UserService.Instance.myUserInfo))
+      .or(
+        myFirstDiscussionLanguageId(
+          this.props.allLanguages,
+          this.props.siteLanguages,
+          UserService.Instance.myUserInfo
+        )
+      )
       .map(Array.of);
 
     return (
@@ -298,6 +305,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
                         enableDownvotes={this.props.enableDownvotes}
                         enableNsfw={this.props.enableNsfw}
                         allLanguages={this.props.allLanguages}
+                        siteLanguages={this.props.siteLanguages}
                       />
                     </>
                   ),
@@ -340,6 +348,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
                         enableDownvotes={this.props.enableDownvotes}
                         enableNsfw={this.props.enableNsfw}
                         allLanguages={this.props.allLanguages}
+                        siteLanguages={this.props.siteLanguages}
                       />
                     </>
                   ),
@@ -359,6 +368,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
                 buttonTitle={None}
                 maxLength={None}
                 allLanguages={this.props.allLanguages}
+                siteLanguages={this.props.siteLanguages}
               />
             </div>
           </div>
@@ -411,6 +421,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
           )}
           <LanguageSelect
             allLanguages={this.props.allLanguages}
+            siteLanguages={this.props.siteLanguages}
             selectedLanguageIds={selectedLangs}
             multiple={false}
             onChange={this.handleLanguageChange}
index efb237bb128e9b48fcda0e245d4ae9fc327d5b1e..d5e26ceb0ea0d8f7914f8a3bd5f88eb28291e73b 100644 (file)
@@ -93,6 +93,7 @@ interface PostListingProps {
   moderators: Option<CommunityModeratorView[]>;
   admins: Option<PersonViewSafe[]>;
   allLanguages: Language[];
+  siteLanguages: number[];
   showCommunity?: boolean;
   showBody?: boolean;
   hideImage?: boolean;
@@ -176,6 +177,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
               enableNsfw={this.props.enableNsfw}
               enableDownvotes={this.props.enableDownvotes}
               allLanguages={this.props.allLanguages}
+              siteLanguages={this.props.siteLanguages}
             />
           </div>
         )}
index 39d46a71a563ee897b47a8f105f272b361346a9d..e5d3e3bccc3cae3d3c6fb6df03bc057773cc8546 100644 (file)
@@ -9,6 +9,7 @@ import { PostListing } from "./post-listing";
 interface PostListingsProps {
   posts: PostView[];
   allLanguages: Language[];
+  siteLanguages: number[];
   showCommunity?: boolean;
   removeDuplicates?: boolean;
   enableDownvotes: boolean;
@@ -43,6 +44,7 @@ export class PostListings extends Component<PostListingsProps, any> {
                 enableDownvotes={this.props.enableDownvotes}
                 enableNsfw={this.props.enableNsfw}
                 allLanguages={this.props.allLanguages}
+                siteLanguages={this.props.siteLanguages}
               />
               <hr className="my-3" />
             </>
index 1ce33817b11be8ebcc87879911d580a2b2cf50fc..7cb9e43619e066c82e499ccffc348375b242e893 100644 (file)
@@ -60,6 +60,7 @@ export class PostReport extends Component<PostReportProps, any> {
           enableNsfw={true}
           viewOnly={true}
           allLanguages={[]}
+          siteLanguages={[]}
           hideImage
         />
         <div>
index 50f0e449ae81211472b87b8a2eb3800a3e11d7cb..d2d5f84322283eae00bb2a7e8557f0b02dd26739 100644 (file)
@@ -367,12 +367,14 @@ export class Post extends Component<any, PostState> {
                     enableDownvotes={enableDownvotes(this.state.siteRes)}
                     enableNsfw={enableNsfw(this.state.siteRes)}
                     allLanguages={this.state.siteRes.all_languages}
+                    siteLanguages={this.state.siteRes.discussion_languages}
                   />
                   <div ref={this.state.commentSectionRef} className="mb-2" />
                   <CommentForm
                     node={Right(res.post_view.post.id)}
                     disabled={res.post_view.post.locked}
                     allLanguages={this.state.siteRes.all_languages}
+                    siteLanguages={this.state.siteRes.discussion_languages}
                   />
                   <div className="d-block d-md-none">
                     <button
@@ -507,6 +509,7 @@ export class Post extends Component<any, PostState> {
                 enableDownvotes={enableDownvotes(this.state.siteRes)}
                 showContext
                 allLanguages={this.state.siteRes.all_languages}
+                siteLanguages={this.state.siteRes.discussion_languages}
               />
             </div>
           ),
@@ -527,6 +530,9 @@ export class Post extends Component<any, PostState> {
             online={res.online}
             enableNsfw={enableNsfw(this.state.siteRes)}
             showIcon
+            allLanguages={this.state.siteRes.all_languages}
+            siteLanguages={this.state.siteRes.discussion_languages}
+            communityLanguages={None}
           />
         </div>
       ),
@@ -611,6 +617,7 @@ export class Post extends Component<any, PostState> {
             admins={Some(this.state.siteRes.admins)}
             enableDownvotes={enableDownvotes(this.state.siteRes)}
             allLanguages={this.state.siteRes.all_languages}
+            siteLanguages={this.state.siteRes.discussion_languages}
           />
         </div>
       ),
index 6c74e2c8bbb96c6e8780a24e881d975c41e29f6b..86b58bea8abbb24b448e78a9b3bde410205bd791 100644 (file)
@@ -136,6 +136,7 @@ export class PrivateMessageForm extends Component<
                 maxLength={None}
                 onContentChange={this.handleContentChange}
                 allLanguages={[]}
+                siteLanguages={[]}
               />
             </div>
           </div>
index 52cd73b78a25417b0ff62b17085973502c6e57d2..b9aacf3afc0602215f995eb350b1adbc6de30c41 100644 (file)
@@ -595,6 +595,7 @@ export class Search extends Component<any, SearchState> {
                   enableDownvotes={enableDownvotes(this.state.siteRes)}
                   enableNsfw={enableNsfw(this.state.siteRes)}
                   allLanguages={this.state.siteRes.all_languages}
+                  siteLanguages={this.state.siteRes.discussion_languages}
                   viewOnly
                 />
               )}
@@ -617,6 +618,7 @@ export class Search extends Component<any, SearchState> {
                   noIndent
                   enableDownvotes={enableDownvotes(this.state.siteRes)}
                   allLanguages={this.state.siteRes.all_languages}
+                  siteLanguages={this.state.siteRes.discussion_languages}
                 />
               )}
               {i.type_ == "communities" && (
@@ -656,6 +658,7 @@ export class Search extends Component<any, SearchState> {
         maxCommentsShown={None}
         enableDownvotes={enableDownvotes(this.state.siteRes)}
         allLanguages={this.state.siteRes.all_languages}
+        siteLanguages={this.state.siteRes.discussion_languages}
       />
     );
   }
@@ -686,6 +689,7 @@ export class Search extends Component<any, SearchState> {
                 enableDownvotes={enableDownvotes(this.state.siteRes)}
                 enableNsfw={enableNsfw(this.state.siteRes)}
                 allLanguages={this.state.siteRes.all_languages}
+                siteLanguages={this.state.siteRes.discussion_languages}
                 viewOnly
               />
             </div>
index d541df065bd8912c0bbb24cddc3b9328b016ac58..5309832505f2ec1c33d3bd6033aa091568ec0d3f 100644 (file)
@@ -14,6 +14,7 @@ import {
   CommunityView,
   GetSiteMetadata,
   GetSiteResponse,
+  Language,
   LemmyHttp,
   LemmyWebsocket,
   ListingType,
@@ -1480,13 +1481,16 @@ export function arrayGet<T>(arr: Array<T>, index: number): Result<T, string> {
 }
 
 export function myFirstDiscussionLanguageId(
+  allLanguages: Language[],
+  siteLanguages: number[],
   myUserInfo = UserService.Instance.myUserInfo
 ): Option<number> {
-  return myUserInfo.andThen(mui =>
-    arrayGet(mui.discussion_languages, 0)
-      .ok()
-      .map(i => i.id)
-  );
+  return arrayGet(
+    selectableLanguages(allLanguages, siteLanguages, false, false, myUserInfo),
+    0
+  )
+    .map(l => l.id)
+    .ok();
 }
 
 export function canCreateCommunity(
@@ -1530,3 +1534,37 @@ export function nsfwCheck(
 export function getRandomFromList<T>(list: T[]): T {
   return list[Math.floor(Math.random() * list.length)];
 }
+
+/**
+ * This shows what language you can select
+ *
+ * Use showAll for the site form
+ * Use showSite for the profile and community forms
+ * Use false for both those to filter on your profile and site ones
+ */
+export function selectableLanguages(
+  allLanguages: Language[],
+  siteLanguages: number[],
+  showAll: boolean,
+  showSite: boolean,
+  myUserInfo = UserService.Instance.myUserInfo
+): Language[] {
+  let allLangIds = allLanguages.map(l => l.id);
+  let myLangs = myUserInfo
+    .map(mui => mui.discussion_languages)
+    .unwrapOr(allLangIds);
+  myLangs = myLangs.length == 0 ? allLangIds : myLangs;
+  let siteLangs = siteLanguages.length == 0 ? allLangIds : siteLanguages;
+
+  if (showAll) {
+    return allLanguages;
+  } else {
+    if (showSite) {
+      return allLanguages.filter(x => siteLangs.includes(x.id));
+    } else {
+      return allLanguages
+        .filter(x => siteLangs.includes(x.id))
+        .filter(x => myLangs.includes(x.id));
+    }
+  }
+}
index 7fe2cd70f296fd3bf25621b0d335ef09742938a9..46475861762ff45574513edaf1560dfd03253e1d 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -2655,7 +2655,7 @@ cssesc@^3.0.0:
   resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
   integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
 
-csstype@^3.1.0:
+csstype@^3.1.0, csstype@^3.1.1:
   version "3.1.1"
   resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9"
   integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==
@@ -4304,6 +4304,13 @@ inferno-create-element@^8.0.3:
   dependencies:
     inferno "8.0.3"
 
+inferno-create-element@^8.0.5:
+  version "8.0.5"
+  resolved "https://registry.yarnpkg.com/inferno-create-element/-/inferno-create-element-8.0.5.tgz#e5ee57926d05b8eafd52039163a18253e8d6a812"
+  integrity sha512-Ad3ptKXyEgvQMwd3YkCd83Arw7MihJtAbfp7Mlu2c2RtJoHY0ZnGs9RWSPKweDFeKjGgYyTlmrGj1hibpooiGA==
+  dependencies:
+    inferno "8.0.5"
+
 inferno-helmet@^5.2.1:
   version "5.2.1"
   resolved "https://registry.yarnpkg.com/inferno-helmet/-/inferno-helmet-5.2.1.tgz#3717f325760aa14abeae82a78af7213f9055a3dc"
@@ -4313,12 +4320,12 @@ inferno-helmet@^5.2.1:
     inferno-side-effect "^1.1.5"
     object-assign "^4.1.1"
 
-inferno-hydrate@^8.0.3:
-  version "8.0.3"
-  resolved "https://registry.yarnpkg.com/inferno-hydrate/-/inferno-hydrate-8.0.3.tgz#75c3c53300a7b7b550dfa93f363956201d86f71f"
-  integrity sha512-7q1BDuVIy3XCmyKlAJhe+s1CLJhl3+gfFcBpjCq9iA7J/Z3kwo/6xjwJQbcQHNrCr/XZvTM+2uVwfxiX6wgYCQ==
+inferno-hydrate@^8.0.5:
+  version "8.0.5"
+  resolved "https://registry.yarnpkg.com/inferno-hydrate/-/inferno-hydrate-8.0.5.tgz#c73adb903122e7030f935b1cf189734583acdce5"
+  integrity sha512-eLbBjstgPhwDSJ+7hcPXbT2nIZQCfesCR3yAu/7AICkXamn2v0f5Zq/5+UlvyHsiuU9BYSOYh95H8hTwHm5zVw==
   dependencies:
-    inferno "8.0.3"
+    inferno "8.0.5"
 
 inferno-i18next-dess@0.0.2:
   version "0.0.2"
@@ -4332,22 +4339,22 @@ inferno-i18next-dess@0.0.2:
     inferno-shared "^8.0.3"
     inferno-vnode-flags "^8.0.3"
 
-inferno-router@^8.0.3:
-  version "8.0.3"
-  resolved "https://registry.yarnpkg.com/inferno-router/-/inferno-router-8.0.3.tgz#ef08da8b0cb158b8920147b260a4f84c64bc3877"
-  integrity sha512-bWkrFfIBDued0LfS/x6Bot3+J3VwGImH3ukSdIFe/GLFPBljDbvayc1JotriJtNFKA1E+1T/OZyw1E6UqIcDaA==
+inferno-router@^8.0.5:
+  version "8.0.5"
+  resolved "https://registry.yarnpkg.com/inferno-router/-/inferno-router-8.0.5.tgz#6cf2d4774f1d858ede65a5f61649796c0866e972"
+  integrity sha512-c1hmVDNsjtG9v7dmArIsYHqX8vR2Z0sNtq6fsW+DHkz7y6VtjM2Po6MheRHBfIn2RSltiIn7+Vew0rtgfPYd8g==
   dependencies:
     history "^5.3.0"
     hoist-non-inferno-statics "^1.1.3"
-    inferno "8.0.3"
+    inferno "8.0.5"
     path-to-regexp-es6 "1.7.0"
 
-inferno-server@^8.0.3:
-  version "8.0.3"
-  resolved "https://registry.yarnpkg.com/inferno-server/-/inferno-server-8.0.3.tgz#4030ac5f20d9ddf191163daa10d3ef4e8b0c4593"
-  integrity sha512-YG9f9e0KsVGV6qByWCkFoGI80SckqIptHtTHMoVHsAbw3krzX414zxwA5H9OTnkubJJsSHBjVtFxaq6hHT/YcA==
+inferno-server@^8.0.5:
+  version "8.0.5"
+  resolved "https://registry.yarnpkg.com/inferno-server/-/inferno-server-8.0.5.tgz#e2f659caba0419080e018567744af8d505030095"
+  integrity sha512-I0suUf8o8ftGH3xSPoBpRrDXMPhrj4UN8o1qDz3WDTYuecTqF7JGtSeu8OP9/kMBlRqTN34Mn+xJV/DGGhnCLQ==
   dependencies:
-    inferno "8.0.3"
+    inferno "8.0.5"
 
 inferno-shared@^8.0.3:
   version "8.0.3"
@@ -4368,6 +4375,11 @@ inferno-vnode-flags@8.0.3, inferno-vnode-flags@^8.0.3:
   resolved "https://registry.yarnpkg.com/inferno-vnode-flags/-/inferno-vnode-flags-8.0.3.tgz#1bd78745033719596211155ae673bd648b266a78"
   integrity sha512-r+wJZNliJWvtcwBd66L3fMSp+M0rinHLilZeLiAX87+ZVPoXKiTDLVmTRI+1j8dm1XmC3IuAHijVfwELnEmoCQ==
 
+inferno-vnode-flags@8.0.5:
+  version "8.0.5"
+  resolved "https://registry.yarnpkg.com/inferno-vnode-flags/-/inferno-vnode-flags-8.0.5.tgz#328767cadcd4270d7e70268e8fec93331dc57e27"
+  integrity sha512-HF/frYUEV/tcCxM73FXwJYgaxKfHZD1fl1UaEwpoFils52ce/1O02GtbGKyd2ts93hZ592W7yu5jKDTM6k/shA==
+
 inferno@8.0.3, inferno@^8.0.3:
   version "8.0.3"
   resolved "https://registry.yarnpkg.com/inferno/-/inferno-8.0.3.tgz#99124f050a9c60995dbdeef8ac258a936df7e62e"
@@ -4377,6 +4389,15 @@ inferno@8.0.3, inferno@^8.0.3:
     inferno-vnode-flags "8.0.3"
     opencollective-postinstall "^2.0.3"
 
+inferno@8.0.5, inferno@^8.0.5:
+  version "8.0.5"
+  resolved "https://registry.yarnpkg.com/inferno/-/inferno-8.0.5.tgz#6c480b92eae6acdf2eba9d4986f98b2b71349977"
+  integrity sha512-dg+h9wdQOR34lTSh9KLhV+62wdnWXI58e7nam9YxXof45IBzgWsKkVuGL0Rp0DkioPNA47bT3v7MvbsGgL58Tg==
+  dependencies:
+    csstype "^3.1.1"
+    inferno-vnode-flags "8.0.5"
+    opencollective-postinstall "^2.0.3"
+
 inflight@^1.0.4, inflight@~1.0.6:
   version "1.0.6"
   resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
@@ -4909,10 +4930,15 @@ lcid@^1.0.0:
   dependencies:
     invert-kv "^1.0.0"
 
-lemmy-js-client@0.17.0-rc.54:
-  version "0.17.0-rc.54"
-  resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.54.tgz#cda3aae8149699f944da354b76710b148cf441dc"
-  integrity sha512-7EhwjfAoq1jmwj6CAFOBNiNQOMOZk/yAsW4kwVRsNGD3pZexW3NrjEoAQx3kFC7mDEUuVbkkRMkl3ND8vUY+Uw==
+lemmy-js-client@0.17.0-rc.57:
+  version "0.17.0-rc.57"
+  resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.57.tgz#f7a243ed53542810e7446b0a28ad162f3e913254"
+  integrity sha512-7kZHi0B+jiKc50itTwngkS5Vxcuvux3LjgD28IXZ049cWQgZDqer6BCmudcbViP+dAoyWs9Fh2SyWkYFhv7bwQ==
+  dependencies:
+    "@sniptt/monads" "^0.5.10"
+    class-transformer "^0.5.1"
+    node-fetch "2.6.6"
+    reflect-metadata "^0.1.13"
 
 levn@^0.4.1:
   version "0.4.1"
@@ -5580,6 +5606,13 @@ node-fetch-npm@^2.0.2:
     json-parse-better-errors "^1.0.0"
     safe-buffer "^5.1.1"
 
+node-fetch@2.6.6:
+  version "2.6.6"
+  resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89"
+  integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==
+  dependencies:
+    whatwg-url "^5.0.0"
+
 node-fetch@^2.6.1:
   version "2.6.7"
   resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"