feat: move user settings to multiple components #889

Merged
konrad merged 27 commits from feature/user-settings into main 2021-10-26 20:58:03 +00:00
2 changed files with 9 additions and 5 deletions
Showing only changes of commit 8d1d80dec8 - Show all commits

View File

@ -35,6 +35,9 @@ export default {
},
},
}),
getters: {
migratorsEnabled: state => state.availableMigrators !== null && state.availableMigrators.length > 0,
konrad marked this conversation as resolved Outdated

use state.availableMigrators?.length > 0

use `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: {
konrad marked this conversation as resolved Outdated

How about making migratorsEnabled a getter in the store?

How about making `migratorsEnabled` a getter in the store?

The rest can be simplified with:

computed: {
	...mapState('config', ['totpEnabled', 'caldavEnabled'],
	[...]
}
The rest can be simplified with: ```js computed: { ...mapState('config', ['totpEnabled', 'caldavEnabled'], [...] } ```

Done (both of it).

Done (both of it).
...mapState('config', ['totpEnabled', 'caldavEnabled']),
migratorsEnabled() {
return this.$store.getters['config/migratorsEnabled']
},
},
}
</script>