diff --git a/package.json b/package.json index f6ea01cb..a6433224 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 98668e76..0a652263 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 a9d4a6c1..0ed2787f 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 159080a1..91c7ba8f 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 (