* Updating translations.
* Adding better subscribe type.
* Fix extra pending string.
"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",
CommentReportView,
CommentView,
ResolveCommentReport,
+ SubscribedType,
} from "lemmy-js-client";
import { i18n } from "../../i18next";
import { CommentNode as CommentNodeI } from "../../interfaces";
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,
ListCommunitiesResponse,
ListingType,
SortType,
+ SubscribedType,
UserOperation,
wsJsonToRes,
wsUserOp,
{numToSI(cv.counts.comments)}
</td>
<td class="text-right">
- {cv.subscribed ? (
+ {cv.subscribed == SubscribedType.Subscribed && (
<button
class="btn btn-link d-inline-block"
onClick={linkEvent(
>
{i18n.t("unsubscribe")}
</button>
- ) : (
+ )}
+ {cv.subscribed == SubscribedType.NotSubscribed && (
<button
class="btn btn-link d-inline-block"
onClick={linkEvent(
{i18n.t("subscribe")}
</button>
)}
+ {cv.subscribed == SubscribedType.Pending && (
+ <div class="text-warning d-inline-block">
+ {i18n.t("subscribe_pending")}
+ </div>
+ )}
</td>
</tr>
))}
FollowCommunity,
PersonViewSafe,
RemoveCommunity,
+ SubscribedType,
toUndefined,
} from "lemmy-js-client";
import { i18n } from "../../i18next";
<BannerIconHeader icon={community.icon} banner={community.banner} />
)}
<span class="mr-2">{community.title}</span>
- {subscribed && (
+ {subscribed == SubscribedType.Subscribed && (
<a
class="btn btn-secondary btn-sm mr-2"
href="#"
{i18n.t("joined")}
</a>
)}
+ {subscribed == SubscribedType.Pending && (
+ <div class="badge badge-warning mr-2">
+ {i18n.t("subscribe_pending")}
+ </div>
+ )}
{community.removed && (
<small className="mr-2 text-muted font-italic">
{i18n.t("removed")}
createPost() {
let cv = this.props.community_view;
return (
- cv.subscribed && (
+ cv.subscribed == SubscribedType.Subscribed && (
<Link
className={`btn btn-secondary btn-block mb-2 ${
cv.community.deleted || cv.community.removed ? "no-click" : ""
let community_view = this.props.community_view;
return (
<div class="mb-2">
- {!community_view.subscribed && (
+ {community_view.subscribed == SubscribedType.NotSubscribed && (
<a
class="btn btn-secondary btn-block"
href="#"
import { None } from "@sniptt/monads";
import { Component, linkEvent } from "inferno";
import { T } from "inferno-i18next-dess";
-import { PostReportView, PostView, ResolvePostReport } from "lemmy-js-client";
+import {
+ PostReportView,
+ PostView,
+ ResolvePostReport,
+ SubscribedType,
+} from "lemmy-js-client";
import { i18n } from "../../i18next";
import { WebSocketService } from "../../services";
import { auth, wsClient } from "../../utils";
community: r.community,
creator_banned_from_community: r.creator_banned_from_community,
counts: r.counts,
- subscribed: false,
+ subscribed: SubscribedType.NotSubscribed,
saved: false,
read: false,
creator_blocked: false,
dependencies:
invert-kv "^1.0.0"
-lemmy-js-client@0.17.0-rc.30:
- version "0.17.0-rc.30"
- resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.30.tgz#91cc926e662a5cd27f87cd2e6cdfcd210176745a"
- integrity sha512-AcG8IZNNTa54BAXEqsL/QNlyPPwLntRLWpIOw9S3u84824d5inL7UCKnyx0UMbQklUuH/D3E2K9WNmZiUdvr3A==
+lemmy-js-client@0.17.0-rc.31:
+ version "0.17.0-rc.31"
+ resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.31.tgz#373ad2dcbb1305bd82e7fb13704fbdb8d2f1c438"
+ integrity sha512-hcjFcOxgplffQullf9HuAGv2ko9wWySrnv+s8FWPPpg4EsixuBjXI+Dh7y0GR/KVs6fRmeXn4YBhR2YdJsBc7A==
levn@^0.4.1:
version "0.4.1"