From: Dessalines Date: Thu, 23 Jun 2022 13:35:53 +0000 (-0400) Subject: Expose pending 2 (#662) X-Git-Url: http://these/git/%22https:/join-lemmy.org/%7B%60%24%7BarchiveTodayUrl%7D/%7Bthis.favIcon%7D?a=commitdiff_plain;h=46c610990a2100901a3d4a2490bdb940e69a67b6;p=lemmy-ui.git Expose pending 2 (#662) * Updating translations. * Adding better subscribe type. * Fix extra pending string. --- diff --git a/package.json b/package.json index f6ea01c..a643322 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "eslint-plugin-prettier": "^4.0.0", "husky": "^7.0.4", "import-sort-style-module": "^6.0.0", - "lemmy-js-client": "0.17.0-rc.30", + "lemmy-js-client": "0.17.0-rc.31", "lint-staged": "^12.4.1", "mini-css-extract-plugin": "^2.6.0", "node-fetch": "^2.6.1", diff --git a/src/shared/components/comment/comment-report.tsx b/src/shared/components/comment/comment-report.tsx index 98668e7..0a65226 100644 --- a/src/shared/components/comment/comment-report.tsx +++ b/src/shared/components/comment/comment-report.tsx @@ -5,6 +5,7 @@ import { CommentReportView, CommentView, ResolveCommentReport, + SubscribedType, } from "lemmy-js-client"; import { i18n } from "../../i18next"; import { CommentNode as CommentNodeI } from "../../interfaces"; @@ -40,7 +41,7 @@ export class CommentReport extends Component { community: r.community, creator_banned_from_community: r.creator_banned_from_community, counts: r.counts, - subscribed: false, + subscribed: SubscribedType.NotSubscribed, saved: false, creator_blocked: false, recipient: None, diff --git a/src/shared/components/community/communities.tsx b/src/shared/components/community/communities.tsx index a9d4a6c..0ed2787 100644 --- a/src/shared/components/community/communities.tsx +++ b/src/shared/components/community/communities.tsx @@ -8,6 +8,7 @@ import { ListCommunitiesResponse, ListingType, SortType, + SubscribedType, UserOperation, wsJsonToRes, wsUserOp, @@ -183,7 +184,7 @@ export class Communities extends Component { {numToSI(cv.counts.comments)} - {cv.subscribed ? ( + {cv.subscribed == SubscribedType.Subscribed && ( - ) : ( + )} + {cv.subscribed == SubscribedType.NotSubscribed && ( )} + {cv.subscribed == SubscribedType.Pending && ( +
+ {i18n.t("subscribe_pending")} +
+ )} ))} diff --git a/src/shared/components/community/sidebar.tsx b/src/shared/components/community/sidebar.tsx index 159080a..91c7ba8 100644 --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@ -9,6 +9,7 @@ import { FollowCommunity, PersonViewSafe, RemoveCommunity, + SubscribedType, toUndefined, } from "lemmy-js-client"; import { i18n } from "../../i18next"; @@ -111,7 +112,7 @@ export class Sidebar extends Component { )} {community.title} - {subscribed && ( + {subscribed == SubscribedType.Subscribed && ( { {i18n.t("joined")} )} + {subscribed == SubscribedType.Pending && ( +
+ {i18n.t("subscribe_pending")} +
+ )} {community.removed && ( {i18n.t("removed")} @@ -257,7 +263,7 @@ export class Sidebar extends Component { createPost() { let cv = this.props.community_view; return ( - cv.subscribed && ( + cv.subscribed == SubscribedType.Subscribed && ( { let community_view = this.props.community_view; return (