Skip to content

Commit

Permalink
refactor: rename initialForm to initForm
Browse files Browse the repository at this point in the history
  • Loading branch information
agalwood committed Jun 12, 2020
1 parent cf3ef76 commit b850757
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/renderer/components/Preference/Advanced.vue
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
import '@/components/Icons/sync'
import '@/components/Icons/refresh'
const initialForm = (config) => {
const initForm = (config) => {
const {
allProxy,
allProxyBackup,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
})
},
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/components/Preference/Basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
} from '@shared/utils'
import { APP_RUN_MODE } from '@shared/constants'
const initialForm = (config) => {
const initForm = (config) => {
const {
autoHideWindow,
dir,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
})
},
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/components/Task/AddTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
import SelectTorrent from '@/components/Task/SelectTorrent'
import { prettifyDir } from '@/utils/native'
import {
initialForm,
initTaskForm,
buildUriPayload,
buildTorrentPayload
} from '@/utils/task'
Expand Down Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/pages/index/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/utils/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b850757

Please sign in to comment.