Commit 71e54c5b authored by Romain DELEAU's avatar Romain DELEAU

fix: move a task to an empty line

parent 9a18b916
......@@ -62,7 +62,10 @@ export class Role {
this.tasks[i][j] = this.tasks[i][j+1];
this.tasks[i][j+1] = tmp;
} else if (direction == 'top') {
if (this.tasks[i-1].some(element => element?.type == 'final' || element?.type == 'repeat')) {
if (!(this.tasks[i-1].some(element => element instanceof Task))) {
this.tasks[i-1][j] = tmp;
this.tasks[i].splice(j, 1);
} else if (this.tasks[i-1].some(element => element?.type == 'final' || element?.type == 'repeat')) {
if (this.tasks[i][j]?.type == 'final' || this.tasks[i][j]?.type == 'repeat') {
this.tasks[i][j] = this.tasks[i-1][this.getLastTaskIndex(i-1)];
this.tasks[i-1][this.getLastTaskIndex(i-1)] = tmp;
......@@ -83,7 +86,10 @@ export class Role {
if (this.tasks[i+2] == null) {
this.tasks[i+2] = [];
}
if (this.tasks[i+1].some(element => element?.type == 'final' || element?.type == 'repeat')) {
if (!(this.tasks[i+1].some(element => element instanceof Task))) {
this.tasks[i+1][j] = tmp;
this.tasks[i].splice(j, 1);
} else if (this.tasks[i+1].some(element => element?.type == 'final' || element?.type == 'repeat')) {
if (this.tasks[i][j]?.type == 'final' || this.tasks[i][j]?.type == 'repeat') {
this.tasks[i][j] = this.tasks[i+1][this.getLastTaskIndex(i+1)];
this.tasks[i+1][this.getLastTaskIndex(i+1)] = tmp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment