Skip to content

Commit

Permalink
Add previous task state on change events
Browse files Browse the repository at this point in the history
  • Loading branch information
ANovokmet committed Jan 18, 2024
1 parent d3431e4 commit 10e67ae
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/entities/Task.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@
function drag(_: HTMLElement) {
function onDrop(event) {
let rowChangeValid = true;
const previousState = {
id: model.id,
resourceId: model.resourceId,
from: model.from,
to: model.to,
};
//row switching
const sourceRow = $rowStore.entities[model.resourceId];
if (event.dragging) {
Expand Down Expand Up @@ -140,12 +147,12 @@
prevTo != newTo ||
(sourceRow && sourceRow.model.id !== targetRow.model.id);
if (changed) {
api.tasks.raise.change({ task: newTask, sourceRow, targetRow });
api.tasks.raise.change({ task: newTask, sourceRow, targetRow, previousState });
}
selectionManager.newTasksAndReflections.push(newTask);
if (changed) {
api.tasks.raise.changed({ task: newTask, sourceRow, targetRow });
api.tasks.raise.changed({ task: newTask, sourceRow, targetRow, previousState });
}
// update shadow tasks
Expand Down

0 comments on commit 10e67ae

Please sign in to comment.