This commit is contained in:
syuilo 2018-09-13 18:23:44 +09:00
parent 03e1d3fbc4
commit 683d3a70b2
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 29 additions and 7 deletions

View file

@ -880,7 +880,7 @@ desktop/views/components/settings.profile.vue:
birthday: "誕生日"
save: "保存"
locked-account: "アカウントの保護"
is-locked: "投稿を非公開にする"
is-locked: "フォローを承認制にする"
other: "その他"
is-bot: "このアカウントはBotです"
is-cat: "このアカウントはCatです"
@ -1353,6 +1353,9 @@ mobile/views/pages/settings/settings.profile.vue:
avatar: "アイコン"
banner: "バナー"
is-cat: "このアカウントはCatです"
is-locked: "フォローを承認制にする"
advanced: "その他"
privacy: "プライバシー"
save: "保存"
saved: "プロフィールを保存しました"
uploading: "アップロード中"

View file

@ -40,11 +40,25 @@
<span slot="text" v-if="bannerUploading">%i18n:@uploading%<mk-ellipsis/></span>
</ui-input>
<ui-switch v-model="isCat">%i18n:@is-cat%</ui-switch>
<ui-button @click="save">%i18n:@save%</ui-button>
<ui-button @click="save(true)">%i18n:@save%</ui-button>
</ui-form>
</section>
<section>
<header>%i18n:@advanced%</header>
<div>
<ui-switch v-model="isCat" @change="save(false)">%i18n:@is-cat%</ui-switch>
</div>
</section>
<section>
<header>%i18n:@privacy%</header>
<div>
<ui-switch v-model="isLocked" @change="save(false)">%i18n:@is-locked%</ui-switch>
</div>
</section>
</ui-card>
</template>
@ -64,6 +78,7 @@ export default Vue.extend({
avatarId: null,
bannerId: null,
isCat: false,
isLocked: false,
saving: false,
avatarUploading: false,
bannerUploading: false
@ -79,6 +94,7 @@ export default Vue.extend({
this.avatarId = this.$store.state.i.avatarId;
this.bannerId = this.$store.state.i.bannerId;
this.isCat = this.$store.state.i.isCat;
this.isLocked = this.$store.state.i.isLocked;
},
methods: {
@ -126,7 +142,7 @@ export default Vue.extend({
});
},
save() {
save(notify) {
this.saving = true;
(this as any).api('i/update', {
@ -136,7 +152,8 @@ export default Vue.extend({
birthday: this.birthday || null,
avatarId: this.avatarId,
bannerId: this.bannerId,
isCat: this.isCat
isCat: this.isCat,
isLocked: this.isLocked
}).then(i => {
this.saving = false;
this.$store.state.i.avatarId = i.avatarId;
@ -144,7 +161,9 @@ export default Vue.extend({
this.$store.state.i.bannerId = i.bannerId;
this.$store.state.i.bannerUrl = i.bannerUrl;
if (notify) {
alert('%i18n:@saved%');
}
});
}
}