Skip to content

A full-featured download manager.

refactor: preferences function

Dr_rOot852266dc169f
diff --git a/src/renderer/components/Preference/Advanced.vue b/src/renderer/components/Preference/Advanced.vue
index d7a11458..8aa0044d 100644
--- a/src/renderer/components/Preference/Advanced.vue
+++ b/src/renderer/components/Preference/Advanced.vue
@@ -229,7 +229,7 @@
components: {
[ShowInFolder.name]: ShowInFolder
},
- data: function () {
+ data () {
const { locale } = this.$store.state.preference.config
const form = initialForm(this.$store.state.preference.config)
const formOriginal = cloneDeep(form)
@@ -244,12 +244,9 @@
}
},
computed: {
- title: function () {
+ title () {
return this.$t('preferences.advanced')
},
- showHideAppMenuOption: function () {
- return is.windows() || is.linux()
- },
...mapState('preference', {
config: state => state.config,
logPath: state => state.config.logPath,
@@ -257,7 +254,7 @@
})
},
watch: {
- 'form.rpcSecret': function (val) {
+ 'form.rpcSecret' (val) {
const url = buildRpcUrl({
port: this.form.rpcListenPort,
secret: val
diff --git a/src/renderer/components/Preference/Basic.vue b/src/renderer/components/Preference/Basic.vue
index 0a0ec163..69f0dbbb 100644
--- a/src/renderer/components/Preference/Basic.vue
+++ b/src/renderer/components/Preference/Basic.vue
@@ -153,8 +153,8 @@
import { prettifyDir } from '@/components/Native/utils'
import {
calcFormLabelWidth,
- diffConfig,
- checkIsNeedRestart
+ checkIsNeedRestart,
+ diffConfig
} from '@shared/utils'
const initialForm = (config) => {
@@ -200,7 +200,7 @@
[SelectDirectory.name]: SelectDirectory,
[ThemeSwitcher.name]: ThemeSwitcher
},
- data: function () {
+ data () {
const { locale } = this.$store.state.preference.config
const form = initialForm(this.$store.state.preference.config)
const formOriginal = cloneDeep(form)
@@ -215,13 +215,13 @@
}
},
computed: {
- title: function () {
+ title () {
return this.$t('preferences.basic')
},
- showHideAppMenuOption: function () {
+ showHideAppMenuOption () {
return is.windows() || is.linux()
},
- downloadDir: function () {
+ downloadDir () {
return prettifyDir(this.form.dir)
},
...mapState('preference', {
diff --git a/src/renderer/components/Preference/Lab.vue b/src/renderer/components/Preference/Lab.vue
index bfc43d64..66b540e6 100644
--- a/src/renderer/components/Preference/Lab.vue
+++ b/src/renderer/components/Preference/Lab.vue
@@ -59,7 +59,7 @@
export default {
name: 'mo-preference-lab',
- data: function () {
+ data () {
const { locale } = this.$store.state.preference.config
const form = initialForm(this.$store.state.preference.config)
const formOriginal = cloneDeep(form)
@@ -72,7 +72,7 @@
}
},
computed: {
- title: function () {
+ title () {
return this.$t('preferences.lab')
},
...mapState('preference', {