From affae3d67f465cafa23ad2bee3454eb5eb859db2 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 23 Apr 2021 20:08:38 -0400 Subject: [PATCH] Adding bot acct settings. Fixes #242 --- lemmy-translations | 2 +- package.json | 2 +- src/shared/components/person.tsx | 83 ++++++++++++++++++++++++-------- yarn.lock | 8 +-- 4 files changed, 68 insertions(+), 27 deletions(-) diff --git a/lemmy-translations b/lemmy-translations index 12e8d61..ef6c991 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 12e8d61e9ba2620b0031e237d87367480452b6fb +Subproject commit ef6c991e345a880d98b165508f28793fef3f922a diff --git a/package.json b/package.json index 7cc904d..0153a92 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "eslint-plugin-prettier": "^3.3.1", "husky": "^6.0.0", "iso-639-1": "^2.1.9", - "lemmy-js-client": "0.11.0-rc.10", + "lemmy-js-client": "0.11.0-rc.11", "lint-staged": "^10.5.4", "mini-css-extract-plugin": "^1.4.1", "node-fetch": "^2.6.1", diff --git a/src/shared/components/person.tsx b/src/shared/components/person.tsx index a38a36e..c0ef9f0 100644 --- a/src/shared/components/person.tsx +++ b/src/shared/components/person.tsx @@ -439,12 +439,23 @@ export class Person extends Component { {i18n.t("logout")} ) : ( - - {i18n.t("send_message")} - + <> + + {i18n.t("send_secure_message")} + + + {i18n.t("send_message")} + + )} {pv.person.bio && ( @@ -484,21 +495,6 @@ export class Person extends Component { ); } - // TODO this isn't used currently - // matrixButton() { - // return ( - // - // {i18n.t("send_secure_message")} - // - // ); - // } - userSettings() { return (
@@ -797,6 +793,37 @@ export class Person extends Component {
+
+
+ + +
+
+
+
+ + +
+
{ i.setState(i.state); } + handleUserSettingsBotAccount(i: Person, event: any) { + i.state.saveUserSettingsForm.bot_account = event.target.checked; + i.setState(i.state); + } + + handleUserSettingsShowBotAccounts(i: Person, event: any) { + i.state.saveUserSettingsForm.show_bot_accounts = event.target.checked; + i.setState(i.state); + } + handleUserSettingsShowScoresChange(i: Person, event: any) { i.state.saveUserSettingsForm.show_scores = event.target.checked; UserService.Instance.localUserView.local_user.show_scores = @@ -1148,6 +1185,10 @@ export class Person extends Component { UserService.Instance.localUserView.person.display_name; this.state.saveUserSettingsForm.show_avatars = UserService.Instance.localUserView.local_user.show_avatars; + this.state.saveUserSettingsForm.bot_account = + UserService.Instance.localUserView.person.bot_account; + this.state.saveUserSettingsForm.show_bot_accounts = + UserService.Instance.localUserView.local_user.show_bot_accounts; this.state.saveUserSettingsForm.show_scores = UserService.Instance.localUserView.local_user.show_scores; this.state.saveUserSettingsForm.email = diff --git a/yarn.lock b/yarn.lock index 712c0a6..eba2f02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5125,10 +5125,10 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -lemmy-js-client@0.11.0-rc.10: - version "0.11.0-rc.10" - resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.11.0-rc.10.tgz#304b5b941a00fe251fb50c81e5ae795e8bf0bd8d" - integrity sha512-bVLMnE1xm7mmmUC9gLIQ7wFNZn8HD3nmE56EhNGgqR76zdjZSSk+8ZqBYHUJ2yOikGebzIm0heMFryIsJuqwTg== +lemmy-js-client@0.11.0-rc.11: + version "0.11.0-rc.11" + resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.11.0-rc.11.tgz#f99be613d08d0c196a16a37f74fdaa3b196f0459" + integrity sha512-IuNzU4+324fhb77JCQ/a/te/gXhQWUvxvtfV3xxQWJ0vG7kWOuz5Rd7KsfSF1d6LbuN9kbO9ebjSRW800ytbsA== levn@^0.4.1: version "0.4.1" -- 2.44.1