Skip to content

A full-featured download manager.

feat: add getTaskOption action

Dr_rOotd67dca00b55d
diff --git a/src/renderer/api/Api.js b/src/renderer/api/Api.js
index 40c8a8ea..ba42cd87 100644
--- a/src/renderer/api/Api.js
+++ b/src/renderer/api/Api.js
@@ -134,6 +134,18 @@ export default class Api {
})
}
+ getOption (params = {}) {
+ const { gid } = params
+ const args = compactUndefined([gid])
+
+ return new Promise((resolve) => {
+ this.client.call('getOption', ...args)
+ .then((data) => {
+ resolve(changeKeysToCamelCase(data))
+ })
+ })
+ }
+
getGlobalStat () {
return this.client.call('getGlobalStat')
}
diff --git a/src/renderer/store/modules/task.js b/src/renderer/store/modules/task.js
index fb197227..97ca58ac 100644
--- a/src/renderer/store/modules/task.js
+++ b/src/renderer/store/modules/task.js
@@ -73,6 +73,14 @@ const actions = {
dispatch('fetchList')
})
},
+ getTaskOption (_, gid) {
+ return new Promise((resolve) => {
+ api.getOption({ gid })
+ .then((data) => {
+ resolve(data)
+ })
+ })
+ },
removeTask ({ dispatch }, task) {
const { gid } = task
return api.forcePauseTask({ gid })