summaryrefslogtreecommitdiff
path: root/src/client/app
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-10-13 20:11:00 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-10-13 20:11:00 +0900
commit65e5cfa68eee619843192f3bf2a3e901a0910101 (patch)
tree6ed53b64d96371a5543208b5815718492aebe753 /src/client/app
parentMerge branch 'develop' of https://github.com/syuilo/misskey into develop (diff)
downloadmisskey-65e5cfa68eee619843192f3bf2a3e901a0910101.tar.gz
misskey-65e5cfa68eee619843192f3bf2a3e901a0910101.tar.bz2
misskey-65e5cfa68eee619843192f3bf2a3e901a0910101.zip
Resolve #2853
Diffstat (limited to 'src/client/app')
-rw-r--r--src/client/app/desktop/views/components/settings.profile.vue42
-rw-r--r--src/client/app/desktop/views/components/ui.header.account.vue2
-rw-r--r--src/client/app/mobile/views/components/ui.nav.vue2
-rw-r--r--src/client/app/mobile/views/pages/settings/settings.profile.vue6
4 files changed, 28 insertions, 24 deletions
diff --git a/src/client/app/desktop/views/components/settings.profile.vue b/src/client/app/desktop/views/components/settings.profile.vue
index 5f465a52bb..15569d3694 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 @@
<ui-button primary @click="save">%i18n:@save%</ui-button>
<section>
<h2>%i18n:@locked-account%</h2>
- <ui-switch v-model="$store.state.i.isLocked" @change="onChangeIsLocked">%i18n:@is-locked%</ui-switch>
+ <ui-switch v-model="isLocked" @change="save(false)">%i18n:@is-locked%</ui-switch>
+ <ui-switch v-model="carefulBot" @change="save(false)">%i18n:@careful-bot%</ui-switch>
</section>
<section>
<h2>%i18n:@other%</h2>
- <ui-switch v-model="$store.state.i.isBot" @change="onChangeIsBot">%i18n:@is-bot%</ui-switch>
- <ui-switch v-model="$store.state.i.isCat" @change="onChangeIsCat">%i18n:@is-cat%</ui-switch>
+ <ui-switch v-model="isBot" @change="save(false)">%i18n:@is-bot%</ui-switch>
+ <ui-switch v-model="isCat" @change="save(false)">%i18n:@is-cat%</ui-switch>
<ui-switch v-model="alwaysMarkNsfw">%i18n:common.always-mark-nsfw%</ui-switch>
</section>
</div>
@@ -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 a541dea121..80fc1648de 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 @@
<li @click="list">
<p>%fa:list%<span>%i18n:@lists%</span>%fa:angle-right%</p>
</li>
- <li @click="followRequests" v-if="$store.state.i.isLocked">
+ <li @click="followRequests" v-if="($store.state.i.isLocked || $store.state.i.carefulBot)">
<p>%fa:envelope R%<span>%i18n:@follow-requests%<i v-if="$store.state.i.pendingReceivedFollowRequestsCount">{{ $store.state.i.pendingReceivedFollowRequestsCount }}</i></span>%fa:angle-right%</p>
</li>
</ul>
diff --git a/src/client/app/mobile/views/components/ui.nav.vue b/src/client/app/mobile/views/components/ui.nav.vue
index c9c0c082b2..068ad74815 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 @@
<li><router-link to="/" :data-active="$route.name == 'index'">%fa:home%%i18n:@timeline%%fa:angle-right%</router-link></li>
<li><router-link to="/i/notifications" :data-active="$route.name == 'notifications'">%fa:R bell%%i18n:@notifications%<template v-if="hasUnreadNotification">%fa:circle%</template>%fa:angle-right%</router-link></li>
<li><router-link to="/i/messaging" :data-active="$route.name == 'messaging'">%fa:R comments%%i18n:@messaging%<template v-if="hasUnreadMessagingMessage">%fa:circle%</template>%fa:angle-right%</router-link></li>
- <li v-if="$store.getters.isSignedIn && $store.state.i.isLocked"><router-link to="/i/received-follow-requests" :data-active="$route.name == 'received-follow-requests'">%fa:R envelope%%i18n:@follow-requests%<template v-if="$store.getters.isSignedIn && $store.state.i.pendingReceivedFollowRequestsCount">%fa:circle%</template>%fa:angle-right%</router-link></li>
+ <li v-if="$store.getters.isSignedIn && ($store.state.i.isLocked || $store.state.i.carefulBot)"><router-link to="/i/received-follow-requests" :data-active="$route.name == 'received-follow-requests'">%fa:R envelope%%i18n:@follow-requests%<template v-if="$store.getters.isSignedIn && $store.state.i.pendingReceivedFollowRequestsCount">%fa:circle%</template>%fa:angle-right%</router-link></li>
<li><router-link to="/reversi" :data-active="$route.name == 'reversi'">%fa:gamepad%%i18n:@game%<template v-if="hasGameInvitation">%fa:circle%</template>%fa:angle-right%</router-link></li>
</ul>
<ul>
diff --git a/src/client/app/mobile/views/pages/settings/settings.profile.vue b/src/client/app/mobile/views/pages/settings/settings.profile.vue
index 77c59faf37..160a05a3e0 100644
--- a/src/client/app/mobile/views/pages/settings/settings.profile.vue
+++ b/src/client/app/mobile/views/pages/settings/settings.profile.vue
@@ -58,6 +58,7 @@
<div>
<ui-switch v-model="isLocked" @change="save(false)">%i18n:@is-locked%</ui-switch>
+ <ui-switch v-model="carefulBot" @change="save(false)">%i18n:@careful-bot%</ui-switch>
</div>
</section>
</ui-card>
@@ -80,6 +81,7 @@ export default Vue.extend({
bannerId: null,
isCat: false,
isLocked: false,
+ carefulBot: false,
saving: false,
avatarUploading: false,
bannerUploading: false
@@ -103,6 +105,7 @@ export default Vue.extend({
this.bannerId = this.$store.state.i.bannerId;
this.isCat = this.$store.state.i.isCat;
this.isLocked = this.$store.state.i.isLocked;
+ this.carefulBot = this.$store.state.i.carefulBot;
},
methods: {
@@ -161,7 +164,8 @@ export default Vue.extend({
avatarId: this.avatarId,
bannerId: this.bannerId,
isCat: this.isCat,
- isLocked: this.isLocked
+ isLocked: this.isLocked,
+ carefulBot: this.carefulBot
}).then(i => {
this.saving = false;
this.$store.state.i.avatarId = i.avatarId;