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: {
|
||||
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) {
|
||||
this.$patch({
|
||||
selectedTasks: tasks,
|
||||
|
@ -147,7 +147,7 @@ export default {
|
||||
*/
|
||||
onSioTaskUpdate(taskUpdate) {
|
||||
if (this.$refs.tasksTable) this.$refs.tasksTable.processTaskUpdate(taskUpdate);
|
||||
|
||||
this.tasks.updateActiveTask(taskUpdate);
|
||||
this.notifs.addTaskUpdate(taskUpdate);
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user