From 415292833106a81a2de7c446de413728b74e786d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 14 Jun 2023 08:21:52 -0400 Subject: [PATCH 01/12] Upping version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd7cf4ad..2298d9e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lemmy-ui", - "version": "0.18.0-beta.6", + "version": "0.18.0-rc.1", "description": "An isomorphic UI for lemmy", "repository": "https://github.com/LemmyNet/lemmy-ui", "license": "AGPL-3.0", From 79f40095416ad623f18aa0042f7be9c7ed691582 Mon Sep 17 00:00:00 2001 From: Andrew DeLisa Date: Thu, 15 Jun 2023 17:42:22 -0400 Subject: [PATCH 02/12] Improve the look of tables (#1299) * feat(css): remove table styling that overrides bootstrap * feat(utils): style MD tables appropriately with bootstrap class --- src/assets/css/main.css | 24 ------------------------ src/shared/utils.ts | 5 ++++- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/assets/css/main.css b/src/assets/css/main.css index e1adfc53..82f8433e 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -80,30 +80,6 @@ overflow-x: auto; } -.md-div table { - border-collapse: collapse; - width: 100%; - margin-bottom: 1rem; - border: 1px solid var(--dark); -} - -.md-div table th, -.md-div table td { - padding: 0.3rem; - vertical-align: top; - border-top: 1px solid var(--dark); - border: 1px solid var(--dark); -} - -.md-div table thead th { - vertical-align: bottom; - border-bottom: 2px solid var(--dark); -} - -.md-div table tbody + tbody { - border-top: 2px solid var(--dark); -} - .vote-bar { margin-top: -6.5px; } diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 4a3b298a..067b78ac 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -739,7 +739,7 @@ function setupMarkdown() { defs: emojiDefs, }) .disable("image"); - var defaultRenderer = md.renderer.rules.image; + const defaultRenderer = md.renderer.rules.image; md.renderer.rules.image = function ( tokens: Token[], idx: number, @@ -758,6 +758,9 @@ function setupMarkdown() { const alt_text = item.content; return `${alt_text}`; }; + md.renderer.rules.table_open = function () { + return ''; + }; } export function getEmojiMart( From 882efe128a870f33c5bff6a97caced79d1b57f6f Mon Sep 17 00:00:00 2001 From: Yuri Pieters Date: Fri, 16 Jun 2023 15:49:23 +0100 Subject: [PATCH 03/12] Match more specific locales to supported ones (#1241) To do this, replace the current system for choosing the language with one that makes use of i18next features. Co-authored-by: Yuri Pieters Co-authored-by: Dessalines --- src/shared/components/common/html-tags.tsx | 6 ++-- src/shared/components/common/moment-time.tsx | 6 ++-- src/shared/components/person/settings.tsx | 7 ++--- src/shared/i18next.ts | 26 ++++++++++++++++-- src/shared/utils.ts | 29 ++------------------ 5 files changed, 33 insertions(+), 41 deletions(-) diff --git a/src/shared/components/common/html-tags.tsx b/src/shared/components/common/html-tags.tsx index 0e6cb2d0..f32b0fc0 100644 --- a/src/shared/components/common/html-tags.tsx +++ b/src/shared/components/common/html-tags.tsx @@ -2,7 +2,8 @@ import { htmlToText } from "html-to-text"; import { Component } from "inferno"; import { Helmet } from "inferno-helmet"; import { httpExternalPath } from "../../env"; -import { getLanguages, md } from "../../utils"; +import { i18n } from "../../i18next"; +import { md } from "../../utils"; interface HtmlTagsProps { title: string; @@ -17,11 +18,10 @@ export class HtmlTags extends Component { const url = httpExternalPath(this.props.path); const desc = this.props.description; const image = this.props.image; - const lang = getLanguages()[0]; return ( - + {["title", "og:title", "twitter:title"].map(t => ( diff --git a/src/shared/components/common/moment-time.tsx b/src/shared/components/common/moment-time.tsx index 10714f5b..30c1682c 100644 --- a/src/shared/components/common/moment-time.tsx +++ b/src/shared/components/common/moment-time.tsx @@ -1,7 +1,7 @@ import { Component } from "inferno"; import moment from "moment"; import { i18n } from "../../i18next"; -import { capitalizeFirstLetter, getLanguages } from "../../utils"; +import { capitalizeFirstLetter } from "../../utils"; import { Icon } from "./icon"; interface MomentTimeProps { @@ -15,9 +15,7 @@ export class MomentTime extends Component { constructor(props: any, context: any) { super(props, context); - const lang = getLanguages(); - - moment.locale(lang); + moment.locale([...i18n.languages]); } createdAndModifiedTimes() { diff --git a/src/shared/components/person/settings.tsx b/src/shared/components/person/settings.tsx index a29f61b0..56d57a7a 100644 --- a/src/shared/components/person/settings.tsx +++ b/src/shared/components/person/settings.tsx @@ -25,7 +25,6 @@ import { fetchCommunities, fetchThemeList, fetchUsers, - getLanguages, myAuth, myAuthRequired, personToChoice, @@ -1058,12 +1057,12 @@ export class Settings extends Component { } handleInterfaceLangChange(i: Settings, event: any) { + const newLang = event.target.value ?? "browser"; + i18n.changeLanguage(newLang === "browser" ? navigator.languages : newLang); + i.setState( s => ((s.saveUserSettingsForm.interface_language = event.target.value), s) ); - i18n.changeLanguage( - getLanguages(i.state.saveUserSettingsForm.interface_language).at(0) - ); } handleDiscussionLanguageChange(val: number[]) { diff --git a/src/shared/i18next.ts b/src/shared/i18next.ts index eaedbbf8..47ca6501 100644 --- a/src/shared/i18next.ts +++ b/src/shared/i18next.ts @@ -1,4 +1,5 @@ import i18next, { i18nTyped, Resource } from "i18next"; +import { UserService } from "./services"; import { ar } from "./translations/ar"; import { bg } from "./translations/bg"; import { ca } from "./translations/ca"; @@ -30,7 +31,7 @@ import { sv } from "./translations/sv"; import { vi } from "./translations/vi"; import { zh } from "./translations/zh"; import { zh_Hant } from "./translations/zh_Hant"; -import { getLanguages } from "./utils"; +import { isBrowser } from "./utils"; export const languages = [ { resource: ar, code: "ar", name: "العربية" }, @@ -73,12 +74,31 @@ function format(value: any, format: any): any { return format === "uppercase" ? value.toUpperCase() : value; } -i18next.init({ +class LanguageDetector { + static readonly type = "languageDetector"; + + detect() { + const langs: string[] = []; + + const myLang = + UserService.Instance.myUserInfo?.local_user_view.local_user + .interface_language ?? "browser"; + + if (myLang !== "browser") langs.push(myLang); + + if (isBrowser()) langs.push(...navigator.languages); + + return langs; + } +} + +i18next.use(LanguageDetector).init({ debug: false, compatibilityJSON: "v3", + supportedLngs: languages.map(l => l.code), + nonExplicitSupportedLngs: true, // load: 'languageOnly', // initImmediate: false, - lng: getLanguages()[0], fallbackLng: "en", resources, interpolation: { format }, diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 067b78ac..766e38a8 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -42,7 +42,7 @@ import moment from "moment"; import tippy from "tippy.js"; import Toastify from "toastify-js"; import { getHttpBase } from "./env"; -import { i18n, languages } from "./i18next"; +import { i18n } from "./i18next"; import { CommentNodeI, DataType, IsoData, VoteType } from "./interfaces"; import { HttpService, UserService } from "./services"; @@ -399,31 +399,6 @@ export function debounce( } as (...e: T) => R; } -export function getLanguages( - override?: string, - myUserInfo = UserService.Instance.myUserInfo -): string[] { - const myLang = myUserInfo?.local_user_view.local_user.interface_language; - const lang = override || myLang || "browser"; - - if (lang == "browser" && isBrowser()) { - return getBrowserLanguages(); - } else { - return [lang]; - } -} - -function getBrowserLanguages(): string[] { - // Intersect lemmy's langs, with the browser langs - const langs = languages ? languages.map(l => l.code) : ["en"]; - - // NOTE, mobile browsers seem to be missing this list, so append en - const allowedLangs = navigator.languages - .concat("en") - .filter(v => langs.includes(v)); - return allowedLangs; -} - export async function fetchThemeList(): Promise { return fetch("/css/themelist").then(res => res.json()); } @@ -1276,7 +1251,7 @@ export function personSelectName({ export function initializeSite(site?: GetSiteResponse) { UserService.Instance.myUserInfo = site?.my_user; - i18n.changeLanguage(getLanguages()[0]); + i18n.changeLanguage(); if (site) { setupEmojiDataModel(site.custom_emojis ?? []); } From b228214cd06b15c0a5346e4ae9d1b1c6479148e8 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Fri, 16 Jun 2023 09:53:46 -0500 Subject: [PATCH 04/12] Re-arrange elements beneath markdown textarea #1057 (#1288) Co-authored-by: SleeplessOne1917 Co-authored-by: Dessalines --- .../components/common/markdown-textarea.tsx | 98 ++++++++++--------- 1 file changed, 51 insertions(+), 47 deletions(-) diff --git a/src/shared/components/common/markdown-textarea.tsx b/src/shared/components/common/markdown-textarea.tsx index 9318d3bb..a4459ac0 100644 --- a/src/shared/components/common/markdown-textarea.tsx +++ b/src/shared/components/common/markdown-textarea.tsx @@ -184,53 +184,6 @@ export class MarkdownTextArea extends Component<
- {this.props.buttonTitle && ( - - )} - {this.props.replyType && ( - - )} - {this.state.content && ( - - )} - {/* A flex expander */} -
- - {this.props.showLanguage && ( - - )} {this.getFormatButton("bold", this.handleInsertBold)} {this.getFormatButton("italic", this.handleInsertItalic)} {this.getFormatButton("link", this.handleInsertLink)} @@ -283,6 +236,57 @@ export class MarkdownTextArea extends Component<
+ +
+ {this.props.showLanguage && ( + + )} + + {/* A flex expander */} +
+ + {this.props.buttonTitle && ( + + )} + {this.props.replyType && ( + + )} + {this.state.content && ( + + )} +
); From 1c26a85fff7fea0f2504fa7f4b75006d389bbdb6 Mon Sep 17 00:00:00 2001 From: Sunny Date: Fri, 16 Jun 2023 15:00:01 +0000 Subject: [PATCH 05/12] Make community IDs more easily selectable (#1306) * Make community IDs more easily selectable * Use T component for alert * Use T component for alert --------- Co-authored-by: SleeplessOne1917 Co-authored-by: Dessalines --- src/shared/components/community/sidebar.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/shared/components/community/sidebar.tsx b/src/shared/components/community/sidebar.tsx index a5c620f3..63378a18 100644 --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@ -1,4 +1,5 @@ import { Component, InfernoNode, linkEvent } from "inferno"; +import { T } from "inferno-i18next-dess"; import { Link } from "inferno-router"; import { AddModToCommunity, @@ -144,10 +145,15 @@ export class Sidebar extends Component { {myUSerInfo && this.blockCommunity()} {!myUSerInfo && (
- {i18n.t("community_not_logged_in_alert", { - community: name, - instance: hostname(actor_id), - })} + + ### +
)} From 64191f2d2104aa5e145ff7f25aef83a983a16f37 Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Fri, 16 Jun 2023 11:02:28 -0400 Subject: [PATCH 06/12] set loading state attribute to false if createPost fails (#1311) Co-authored-by: Dessalines --- src/shared/components/post/create-post.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/components/post/create-post.tsx b/src/shared/components/post/create-post.tsx index 71fac79a..c7597917 100644 --- a/src/shared/components/post/create-post.tsx +++ b/src/shared/components/post/create-post.tsx @@ -224,6 +224,10 @@ export class CreatePost extends Component< if (res.state === "success") { const postId = res.data.post_view.post.id; this.props.history.replace(`/post/${postId}`); + } else { + this.setState({ + loading: false, + }); } } From af7c0abdbab8b7081b235134f4ee5b2183491014 Mon Sep 17 00:00:00 2001 From: ludrol <37674089+ludrol@users.noreply.github.com> Date: Fri, 16 Jun 2023 17:44:47 +0200 Subject: [PATCH 07/12] changed required checkbox (#1318) Co-authored-by: Dessalines --- .github/ISSUE_TEMPLATE/BUG_REPORT.yml | 2 +- .github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml index 2273a138..ae2d4e51 100644 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml @@ -21,7 +21,7 @@ body: - label: Is this only a single bug? Do not put multiple bugs in one issue. required: true - label: Is this a server side (not related to the UI) issue? Use the [Lemmy back end](https://github.com/LemmyNet/lemmy) repo. - required: true + required: false - type: textarea id: summary attributes: diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml index 2f6f3fc1..3c75050a 100644 --- a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml @@ -19,7 +19,7 @@ body: - label: Is this only a feature request? Do not put multiple feature requests in one issue. required: true - label: Is this a server side (not related to the UI) issue? Use the [Lemmy back end](https://github.com/LemmyNet/lemmy) repo. - required: true + required: false - type: textarea id: problem attributes: From 48ced9bd34c221d5ea408d738e5637d80caa8c33 Mon Sep 17 00:00:00 2001 From: Peter Willemsen Date: Fri, 16 Jun 2023 17:45:36 +0200 Subject: [PATCH 08/12] hardcoded node version due to bug "Text file busy" error introduced in node 20.3 (#1320) Co-authored-by: Dessalines --- Dockerfile | 2 +- dev.dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3d6d6212..2b36581d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:alpine as builder +FROM node:20.2-alpine as builder RUN apk update && apk add curl yarn python3 build-base gcc wget git --no-cache RUN curl -sf https://gobinaries.com/tj/node-prune | sh diff --git a/dev.dockerfile b/dev.dockerfile index 0e925c0a..3bfc10da 100644 --- a/dev.dockerfile +++ b/dev.dockerfile @@ -1,4 +1,4 @@ -FROM node:alpine as builder +FROM node:20.2-alpine as builder RUN apk update && apk add curl yarn python3 build-base gcc wget git --no-cache WORKDIR /usr/src/app From 80e2c9602e4bad45bd9f3342a1a6114bfafdf1da Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Fri, 16 Jun 2023 11:52:47 -0400 Subject: [PATCH 09/12] Admin Settings: Bugfixes (#1313) * move loading state to AdminSettings, pass as prop, tweak margin on some labels, add missing bind * default loading state to false on setup.tsx, add util * rename util to make more sense * make @dessalines suggested changes --- src/shared/components/home/admin-settings.tsx | 26 +++++++++++++ src/shared/components/home/emojis-form.tsx | 7 ++-- .../components/home/rate-limit-form.tsx | 8 ++-- src/shared/components/home/setup.tsx | 1 + src/shared/components/home/site-form.tsx | 38 +++++++++++-------- src/shared/components/home/tagline-form.tsx | 12 ++---- src/shared/utils.ts | 5 +++ 7 files changed, 63 insertions(+), 34 deletions(-) diff --git a/src/shared/components/home/admin-settings.tsx b/src/shared/components/home/admin-settings.tsx index 9b7256d0..302e96bd 100644 --- a/src/shared/components/home/admin-settings.tsx +++ b/src/shared/components/home/admin-settings.tsx @@ -39,6 +39,8 @@ interface AdminSettingsState { instancesRes: RequestState; bannedRes: RequestState; leaveAdminTeamRes: RequestState; + emojiLoading: boolean; + loading: boolean; themeList: string[]; isIsomorphic: boolean; } @@ -52,6 +54,8 @@ export class AdminSettings extends Component { bannedRes: { state: "empty" }, instancesRes: { state: "empty" }, leaveAdminTeamRes: { state: "empty" }, + emojiLoading: false, + loading: false, themeList: [], isIsomorphic: false, }; @@ -81,6 +85,7 @@ export class AdminSettings extends Component { bannedRes: { state: "loading" }, instancesRes: { state: "loading" }, themeList: [], + loading: true, }); const auth = myAuthRequired(); @@ -95,6 +100,7 @@ export class AdminSettings extends Component { bannedRes, instancesRes, themeList, + loading: false, }); } @@ -156,6 +162,7 @@ export class AdminSettings extends Component { onSaveSite={this.handleEditSite} siteRes={this.state.siteRes} themeList={this.state.themeList} + loading={this.state.loading} />
@@ -174,6 +181,7 @@ export class AdminSettings extends Component { this.state.siteRes.site_view.local_site_rate_limit } onSaveSite={this.handleEditSite} + loading={this.state.loading} /> ), }, @@ -185,6 +193,7 @@ export class AdminSettings extends Component {
), @@ -198,6 +207,7 @@ export class AdminSettings extends Component { onCreate={this.handleCreateEmoji} onDelete={this.handleDeleteEmoji} onEdit={this.handleEditEmoji} + loading={this.state.emojiLoading} /> ), @@ -266,6 +276,8 @@ export class AdminSettings extends Component { } async handleEditSite(form: EditSite) { + this.setState({ loading: true }); + const editRes = await HttpService.client.editSite(form); if (editRes.state === "success") { @@ -278,6 +290,8 @@ export class AdminSettings extends Component { toast(i18n.t("site_saved")); } + this.setState({ loading: false }); + return editRes; } @@ -300,23 +314,35 @@ export class AdminSettings extends Component { } async handleEditEmoji(form: EditCustomEmoji) { + this.setState({ emojiLoading: true }); + const res = await HttpService.client.editCustomEmoji(form); if (res.state === "success") { updateEmojiDataModel(res.data.custom_emoji); } + + this.setState({ emojiLoading: false }); } async handleDeleteEmoji(form: DeleteCustomEmoji) { + this.setState({ emojiLoading: true }); + const res = await HttpService.client.deleteCustomEmoji(form); if (res.state === "success") { removeFromEmojiDataModel(res.data.id); } + + this.setState({ emojiLoading: false }); } async handleCreateEmoji(form: CreateCustomEmoji) { + this.setState({ emojiLoading: true }); + const res = await HttpService.client.createCustomEmoji(form); if (res.state === "success") { updateEmojiDataModel(res.data.custom_emoji); } + + this.setState({ emojiLoading: false }); } } diff --git a/src/shared/components/home/emojis-form.tsx b/src/shared/components/home/emojis-form.tsx index 171b7c99..f77f5125 100644 --- a/src/shared/components/home/emojis-form.tsx +++ b/src/shared/components/home/emojis-form.tsx @@ -23,12 +23,12 @@ interface EmojiFormProps { onEdit(form: EditCustomEmoji): void; onCreate(form: CreateCustomEmoji): void; onDelete(form: DeleteCustomEmoji): void; + loading: boolean; } interface EmojiFormState { siteRes: GetSiteResponse; customEmojis: CustomEmojiViewForm[]; - loading: boolean; page: number; } @@ -47,7 +47,6 @@ export class EmojiForm extends Component { private isoData = setIsoData(this.context); private itemsPerPage = 15; private emptyState: EmojiFormState = { - loading: false, siteRes: this.isoData.site_res, customEmojis: this.isoData.site_res.custom_emojis.map((x, index) => ({ id: x.custom_emoji.id, @@ -223,7 +222,7 @@ export class EmojiForm extends Component { data-tippy-content={i18n.t("save")} aria-label={i18n.t("save")} disabled={ - this.state.loading || + this.props.loading || !this.canEdit(cv) || !cv.changed } @@ -243,7 +242,7 @@ export class EmojiForm extends Component { )} data-tippy-content={i18n.t("delete")} aria-label={i18n.t("delete")} - disabled={this.state.loading} + disabled={this.props.loading} title={i18n.t("delete")} > { state: RateLimitFormState = { - loading: false, form: this.props.rateLimits, }; constructor(props: RateLimitFormProps, context: any) { @@ -164,9 +162,9 @@ export default class RateLimitsForm extends Component< - ) : ( - - ))} + {subscribed == "NotSubscribed" && ( + + )} ); } @@ -668,10 +648,11 @@ export class Sidebar extends Component { } handleBlockCommunity(i: Sidebar) { - i.setState({ blockCommunityLoading: true }); + const { community, blocked } = i.props.community_view; + i.props.onBlockCommunity({ - community_id: 0, - block: !i.props.community_view.blocked, + community_id: community.id, + block: !blocked, auth: myAuthRequired(), }); } diff --git a/src/shared/components/post/post.tsx b/src/shared/components/post/post.tsx index 9c68532b..51365803 100644 --- a/src/shared/components/post/post.tsx +++ b/src/shared/components/post/post.tsx @@ -729,19 +729,14 @@ export class Post extends Component { async handleBlockCommunity(form: BlockCommunity) { const blockCommunityRes = await HttpService.client.blockCommunity(form); - // TODO Probably isn't necessary - this.setState(s => { - if ( - s.postRes.state == "success" && - blockCommunityRes.state == "success" - ) { - s.postRes.data.community_view = blockCommunityRes.data.community_view; - } - return s; - }); - if (blockCommunityRes.state == "success") { updateCommunityBlock(blockCommunityRes.data); + this.setState(s => { + if (s.postRes.state == "success") { + s.postRes.data.community_view.blocked = + blockCommunityRes.data.blocked; + } + }); } } From 6e3ebbd085f0ec334984c4a16d2bbcb45c96f37e Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 16 Jun 2023 14:31:21 -0400 Subject: [PATCH 11/12] Adding codeowners. --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6df17d57..76916e60 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @dessalines @SleeplessOne1917 +* @dessalines @SleeplessOne1917 @alectrocute From e0cc7ba3c35994a490038d417686f1198cb58018 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 16 Jun 2023 17:06:14 -0400 Subject: [PATCH 12/12] Adding a few more 0.18.0 API changes. (#1324) - Removes number_online --- package.json | 2 +- src/shared/components/community/community.tsx | 1 - src/shared/components/community/sidebar.tsx | 7 ------- src/shared/components/home/home.tsx | 4 ---- src/shared/components/home/site-form.tsx | 1 - src/shared/components/home/site-sidebar.tsx | 8 -------- src/shared/components/post/post.tsx | 1 - yarn.lock | 8 ++++---- 8 files changed, 5 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 2298d9e1..b7c48c79 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "inferno-server": "^8.1.1", "isomorphic-cookie": "^1.2.4", "jwt-decode": "^3.1.2", - "lemmy-js-client": "0.17.2-rc.24", + "lemmy-js-client": "0.18.0-rc.1", "lodash": "^4.17.21", "markdown-it": "^13.0.1", "markdown-it-container": "^3.0.0", diff --git a/src/shared/components/community/community.tsx b/src/shared/components/community/community.tsx index 05fa55e1..f2d7ad72 100644 --- a/src/shared/components/community/community.tsx +++ b/src/shared/components/community/community.tsx @@ -360,7 +360,6 @@ export class Community extends Component< community_view={res.community_view} moderators={res.moderators} admins={site_res.admins} - online={res.online} enableNsfw={enableNsfw(site_res)} editable allLanguages={site_res.all_languages} diff --git a/src/shared/components/community/sidebar.tsx b/src/shared/components/community/sidebar.tsx index 57400f48..56b1ef27 100644 --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@ -39,7 +39,6 @@ interface SidebarProps { allLanguages: Language[]; siteLanguages: number[]; communityLanguages?: number[]; - online: number; enableNsfw?: boolean; showIcon?: boolean; editable?: boolean; @@ -237,12 +236,6 @@ export class Sidebar extends Component { const counts = community_view.counts; return (
    -
  • - {i18n.t("number_online", { - count: this.props.online, - formattedCount: numToSI(this.props.online), - })} -
  • { siteRes: { site_view: { counts, site }, admins, - online, }, showSubscribedMobile, showTrendingMobile, @@ -393,7 +392,6 @@ export class Home extends Component { site={site} admins={admins} counts={counts} - online={online} showLocal={showLocal(this.isoData)} /> )} @@ -417,7 +415,6 @@ export class Home extends Component { siteRes: { site_view: { counts, site }, admins, - online, }, } = this.state; @@ -443,7 +440,6 @@ export class Home extends Component { site={site} admins={admins} counts={counts} - online={online} showLocal={showLocal(this.isoData)} /> {this.hasFollows && ( diff --git a/src/shared/components/home/site-form.tsx b/src/shared/components/home/site-form.tsx index 8b56808e..4035c74f 100644 --- a/src/shared/components/home/site-form.tsx +++ b/src/shared/components/home/site-form.tsx @@ -81,7 +81,6 @@ export class SiteForm extends Component { slur_filter_regex: ls.slur_filter_regex, actor_name_max_length: ls.actor_name_max_length, federation_enabled: ls.federation_enabled, - federation_debug: ls.federation_debug, federation_worker_count: ls.federation_worker_count, captcha_enabled: ls.captcha_enabled, captcha_difficulty: ls.captcha_difficulty, diff --git a/src/shared/components/home/site-sidebar.tsx b/src/shared/components/home/site-sidebar.tsx index 051c3afd..be7cdf76 100644 --- a/src/shared/components/home/site-sidebar.tsx +++ b/src/shared/components/home/site-sidebar.tsx @@ -12,7 +12,6 @@ interface SiteSidebarProps { showLocal: boolean; counts?: SiteAggregates; admins?: PersonView[]; - online?: number; } interface SiteSidebarState { @@ -99,15 +98,8 @@ export class SiteSidebar extends Component { badges(siteAggregates: SiteAggregates) { const counts = siteAggregates; - const online = this.props.online ?? 1; return (
      -
    • - {i18n.t("number_online", { - count: online, - formattedCount: numToSI(online), - })} -
    • { community_view={res.data.community_view} moderators={res.data.moderators} admins={this.state.siteRes.admins} - online={res.data.online} enableNsfw={enableNsfw(this.state.siteRes)} showIcon allLanguages={this.state.siteRes.all_languages} diff --git a/yarn.lock b/yarn.lock index f783f07f..7cd64474 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5615,10 +5615,10 @@ leac@^0.6.0: resolved "https://registry.yarnpkg.com/leac/-/leac-0.6.0.tgz#dcf136e382e666bd2475f44a1096061b70dc0912" integrity sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg== -lemmy-js-client@0.17.2-rc.24: - version "0.17.2-rc.24" - resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.24.tgz#3b09233a6d89286e559be2e840d81c0c549562ad" - integrity sha512-aSHz7UTcwnwnNd9poY8tEXP7RA9ieZm9MAfSljcbCNU5ds9CASXYNodmraUVJiqCmT4HWnj7IeVmBC9r7nTHnw== +lemmy-js-client@0.18.0-rc.1: + version "0.18.0-rc.1" + resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.18.0-rc.1.tgz#fd0c88810572d90413696011ebaed19e3b8162d8" + integrity sha512-lQe443Nr5UCSoY+IxmT7mBe0IRF6EAZ/4PJSRoPSL+U8A+egMMBPbuxnisHzLsC+eDOWRUIgOqZlwlaRnbmuig== dependencies: cross-fetch "^3.1.5" form-data "^4.0.0"