feat: add hide dotfiles param (#1148)

This commit is contained in:
Tiger Nie
2020-11-20 18:51:28 +08:00
committed by GitHub
parent dcbc3286e2
commit 10e399b3c3
8 changed files with 55 additions and 11 deletions

View File

@@ -6,6 +6,7 @@
</div>
<div class="card-content">
<p><input type="checkbox" v-model="hideDotfiles"> {{ $t('settings.hideDotfiles') }}</p>
<h3>{{ $t('settings.language') }}</h3>
<languages class="input input--block" :locale.sync="locale"></languages>
</div>
@@ -67,6 +68,7 @@ export default {
},
created () {
this.locale = this.user.locale
this.hideDotfiles = this.user.hideDotfiles
},
methods: {
...mapMutations([ 'updateUser' ]),
@@ -90,8 +92,8 @@ export default {
event.preventDefault()
try {
const data = { id: this.user.id, locale: this.locale }
await api.update(data, ['locale'])
const data = { id: this.user.id, locale: this.locale, hideDotfiles: this.hideDotfiles }
await api.update(data, ['locale', 'hideDotfiles'])
this.updateUser(data)
this.$showSuccess(this.$t('settings.settingsUpdated'))
} catch (e) {