Webapp: update task details when a task update is received
Fix an issue where the task details panel was not updated when the Manager sends a task update.
This commit is contained in:
parent
30a26bf6d2
commit
e4e24fabf2
@ -44,6 +44,16 @@ export const useTasks = defineStore('tasks', {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
updateActiveTask(taskUpdate) {
|
||||||
|
if (!this.activeTask) return;
|
||||||
|
|
||||||
|
// Refuse to handle task update of another task.
|
||||||
|
if (this.activeTask.id != taskUpdate.id) return;
|
||||||
|
|
||||||
|
for (let field in taskUpdate) {
|
||||||
|
this.activeTask[field] = taskUpdate[field];
|
||||||
|
}
|
||||||
|
},
|
||||||
setSelectedTasks(tasks) {
|
setSelectedTasks(tasks) {
|
||||||
this.$patch({
|
this.$patch({
|
||||||
selectedTasks: tasks,
|
selectedTasks: tasks,
|
||||||
|
@ -147,7 +147,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
onSioTaskUpdate(taskUpdate) {
|
onSioTaskUpdate(taskUpdate) {
|
||||||
if (this.$refs.tasksTable) this.$refs.tasksTable.processTaskUpdate(taskUpdate);
|
if (this.$refs.tasksTable) this.$refs.tasksTable.processTaskUpdate(taskUpdate);
|
||||||
|
this.tasks.updateActiveTask(taskUpdate);
|
||||||
this.notifs.addTaskUpdate(taskUpdate);
|
this.notifs.addTaskUpdate(taskUpdate);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user