Update:Replace library scan toast with task manager #1279

This commit is contained in:
advplyr 2023-10-20 17:46:18 -05:00
parent 6f65350269
commit bef6549805
7 changed files with 61 additions and 19 deletions

View file

@ -28,5 +28,21 @@ class TaskManager {
SocketAuthority.emitter('task_finished', task.toJSON())
}
}
/**
* Create new task and add
*
* @param {string} action
* @param {string} title
* @param {string} description
* @param {boolean} showSuccess
* @param {Object} [data]
*/
createAndAddTask(action, title, description, showSuccess, data = {}) {
const task = new Task()
task.setData(action, title, description, showSuccess, data)
this.addTask(task)
return task
}
}
module.exports = new TaskManager()