Skip to content

A full-featured download manager.

refactor: rename initialForm to initForm

Dr_rOotb8507570c621
diff --git a/src/renderer/components/Preference/Advanced.vue b/src/renderer/components/Preference/Advanced.vue
index 3b0c3748..92143183 100644
--- a/src/renderer/components/Preference/Advanced.vue
+++ b/src/renderer/components/Preference/Advanced.vue
@@ -341,7 +341,7 @@
import '@/components/Icons/sync'
import '@/components/Icons/refresh'
- const initialForm = (config) => {
+ const initForm = (config) => {
const {
allProxy,
allProxyBackup,
@@ -395,7 +395,7 @@
},
data () {
const { locale } = this.$store.state.preference.config
- const form = initialForm(this.$store.state.preference.config)
+ const form = initForm(this.$store.state.preference.config)
const formOriginal = cloneDeep(form)
return {
@@ -524,7 +524,7 @@
syncFormConfig () {
this.$store.dispatch('preference/fetchPreference')
.then((config) => {
- this.form = initialForm(config)
+ this.form = initForm(config)
this.formOriginal = cloneDeep(this.form)
})
},
diff --git a/src/renderer/components/Preference/Basic.vue b/src/renderer/components/Preference/Basic.vue
index b2650d7a..451db8f6 100644
--- a/src/renderer/components/Preference/Basic.vue
+++ b/src/renderer/components/Preference/Basic.vue
@@ -217,7 +217,7 @@
} from '@shared/utils'
import { APP_RUN_MODE } from '@shared/constants'
- const initialForm = (config) => {
+ const initForm = (config) => {
const {
autoHideWindow,
dir,
@@ -269,7 +269,7 @@
},
data () {
const { locale } = this.$store.state.preference.config
- const form = initialForm(this.$store.state.preference.config)
+ const form = initForm(this.$store.state.preference.config)
const formOriginal = cloneDeep(form)
return {
@@ -379,7 +379,7 @@
syncFormConfig () {
this.$store.dispatch('preference/fetchPreference')
.then((config) => {
- this.form = initialForm(config)
+ this.form = initForm(config)
this.formOriginal = cloneDeep(this.form)
})
},
diff --git a/src/renderer/components/Task/AddTask.vue b/src/renderer/components/Task/AddTask.vue
index 09b14772..c8709240 100644
--- a/src/renderer/components/Task/AddTask.vue
+++ b/src/renderer/components/Task/AddTask.vue
@@ -174,7 +174,7 @@
import SelectTorrent from '@/components/Task/SelectTorrent'
import { prettifyDir } from '@/utils/native'
import {
- initialForm,
+ initTaskForm,
buildUriPayload,
buildTorrentPayload
} from '@/utils/task'
@@ -254,7 +254,7 @@
}
},
handleOpen () {
- this.form = initialForm(this.$store.state)
+ this.form = initTaskForm(this.$store.state)
if (this.taskType === ADD_TASK_TYPE.URI) {
this.autofillResourceLink()
setTimeout(() => {
@@ -309,7 +309,7 @@
},
reset () {
this.showAdvanced = false
- this.form = initialForm(this.$store.state)
+ this.form = initTaskForm(this.$store.state)
},
addTask (type, form) {
let payload = null
diff --git a/src/renderer/pages/index/commands.js b/src/renderer/pages/index/commands.js
index 389e12e3..c6a834cc 100644
--- a/src/renderer/pages/index/commands.js
+++ b/src/renderer/pages/index/commands.js
@@ -8,7 +8,7 @@ import { ADD_TASK_TYPE } from '@shared/constants'
import { getLocaleManager } from '@/components/Locale'
import { commands } from '@/components/CommandManager/instance'
import {
- initialForm,
+ initTaskForm,
buildUriPayload,
buildTorrentPayload
} from '@/utils/task'
@@ -63,7 +63,7 @@ const addTaskSilent = (type) => {
}
const addTaskByType = (type) => {
- const form = initialForm(store.state)
+ const form = initTaskForm(store.state)
let payload = null
if (type === ADD_TASK_TYPE.URI) {
diff --git a/src/renderer/utils/task.js b/src/renderer/utils/task.js
index 32bae95d..afb4e602 100644
--- a/src/renderer/utils/task.js
+++ b/src/renderer/utils/task.js
@@ -8,7 +8,7 @@ import {
import { splitTaskLinks } from '@shared/utils'
import { buildOuts } from '@shared/utils/rename'
-export const initialForm = state => {
+export const initTaskForm = state => {
const { addTaskUrl, addTaskOptions } = state.app
const {
allProxy,