chore: simplify vuex state
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2021-10-25 21:36:53 +02:00
parent f26feafee5
commit 8d1d80dec8
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 9 additions and 5 deletions

View File

@ -35,6 +35,9 @@ export default {
},
},
}),
getters: {
migratorsEnabled: state => state.availableMigrators !== null && state.availableMigrators.length > 0,
},
mutations: {
[CONFIG](state, config) {
state.version = config.version

View File

@ -63,11 +63,12 @@ export default {
mounted() {
this.setTitle(this.$t('user.settings.title'))
},
computed: mapState({
totpEnabled: state => state.config.totpEnabled,
migratorsEnabled: state => state.config.availableMigrators !== null && state.config.availableMigrators.length > 0,
caldavEnabled: state => state.config.caldavEnabled,
}),
computed: {
...mapState('config', ['totpEnabled', 'caldavEnabled']),
migratorsEnabled() {
return this.$store.getters['config/migratorsEnabled']
},
},
}
</script>