From 65e5cfa68eee619843192f3bf2a3e901a0910101 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 13 Oct 2018 20:11:00 +0900 Subject: [PATCH] Resolve #2853 --- locales/ja-JP.yml | 2 + .../views/components/settings.profile.vue | 42 +++---- .../views/components/ui.header.account.vue | 2 +- .../app/mobile/views/components/ui.nav.vue | 2 +- .../views/pages/settings/settings.profile.vue | 6 +- src/models/user.ts | 11 +- src/server/api/endpoints/i/update.ts | 7 ++ src/services/following/create.ts | 119 +++++++++--------- 8 files changed, 109 insertions(+), 82 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index f90f90650..560dca665 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -938,6 +938,7 @@ desktop/views/components/settings.profile.vue: save: "保存" locked-account: "アカウントの保護" is-locked: "フォローを承認制にする" + careful-bot: "Botからのフォローだけ承認制にする" other: "その他" is-bot: "このアカウントはBotです" is-cat: "このアカウントはCatです" @@ -1420,6 +1421,7 @@ mobile/views/pages/settings/settings.profile.vue: banner: "バナー" is-cat: "このアカウントはCatです" is-locked: "フォローを承認制にする" + careful-bot: "Botからのフォローだけ承認制にする" advanced: "その他" privacy: "プライバシー" save: "保存" diff --git a/src/client/app/desktop/views/components/settings.profile.vue b/src/client/app/desktop/views/components/settings.profile.vue index 5f465a52b..15569d369 100644 --- a/src/client/app/desktop/views/components/settings.profile.vue +++ b/src/client/app/desktop/views/components/settings.profile.vue @@ -21,12 +21,13 @@ %i18n:@save%

%i18n:@locked-account%

- %i18n:@is-locked% + %i18n:@is-locked% + %i18n:@careful-bot%

%i18n:@other%

- %i18n:@is-bot% - %i18n:@is-cat% + %i18n:@is-bot% + %i18n:@is-cat% %i18n:common.always-mark-nsfw%
@@ -42,6 +43,10 @@ export default Vue.extend({ location: null, description: null, birthday: null, + isBot: false, + isCat: false, + isLocked: false, + carefulBot: false, }; }, computed: { @@ -55,34 +60,29 @@ export default Vue.extend({ this.location = this.$store.state.i.profile.location; this.description = this.$store.state.i.description; this.birthday = this.$store.state.i.profile.birthday; + this.isCat = this.$store.state.i.isCat; + this.isBot = this.$store.state.i.isBot; + this.isLocked = this.$store.state.i.isLocked; + this.carefulBot = this.$store.state.i.carefulBot; }, methods: { updateAvatar() { (this as any).apis.updateAvatar(); }, - save() { + save(notify) { (this as any).api('i/update', { name: this.name || null, location: this.location || null, description: this.description || null, - birthday: this.birthday || null + birthday: this.birthday || null, + isCat: this.isCat, + isBot: this.isBot, + isLocked: this.isLocked, + carefulBot: this.carefulBot }).then(() => { - (this as any).apis.notify('%i18n:@profile-updated%'); - }); - }, - onChangeIsLocked() { - (this as any).api('i/update', { - isLocked: this.$store.state.i.isLocked - }); - }, - onChangeIsBot() { - (this as any).api('i/update', { - isBot: this.$store.state.i.isBot - }); - }, - onChangeIsCat() { - (this as any).api('i/update', { - isCat: this.$store.state.i.isCat + if (notify) { + (this as any).apis.notify('%i18n:@profile-updated%'); + } }); } } diff --git a/src/client/app/desktop/views/components/ui.header.account.vue b/src/client/app/desktop/views/components/ui.header.account.vue index a541dea12..80fc1648d 100644 --- a/src/client/app/desktop/views/components/ui.header.account.vue +++ b/src/client/app/desktop/views/components/ui.header.account.vue @@ -19,7 +19,7 @@
  • %fa:list%%i18n:@lists%%fa:angle-right%

  • -
  • +
  • %fa:envelope R%%i18n:@follow-requests%{{ $store.state.i.pendingReceivedFollowRequestsCount }}%fa:angle-right%

  • diff --git a/src/client/app/mobile/views/components/ui.nav.vue b/src/client/app/mobile/views/components/ui.nav.vue index c9c0c082b..068ad7481 100644 --- a/src/client/app/mobile/views/components/ui.nav.vue +++ b/src/client/app/mobile/views/components/ui.nav.vue @@ -18,7 +18,7 @@
  • %fa:home%%i18n:@timeline%%fa:angle-right%
  • %fa:R bell%%i18n:@notifications%%fa:angle-right%
  • %fa:R comments%%i18n:@messaging%%fa:angle-right%
  • -
  • %fa:R envelope%%i18n:@follow-requests%%fa:angle-right%
  • +
  • %fa:R envelope%%i18n:@follow-requests%%fa:angle-right%
  • %fa:gamepad%%i18n:@game%%fa:angle-right%