Skip to content

Commit dfef472

Browse files
committed
fix bug in tasks keyboad handling which I very recently introduced
1 parent 59eea8c commit dfef472

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/packages/frontend/client/api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ async function callApi(
6767
await delay(RETRY_DELAY_MS);
6868
return await callApi(endpoint, args, numRetriesOnFail - 1);
6969
}
70-
console.log("json = ", json);
7170
if (json == null) {
7271
throw Error("timeout -- try again later");
7372
}

src/packages/frontend/editors/task-editor/actions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,14 @@ export class TaskActions extends Actions<TaskState> {
533533
this.set_local_task_state(task_id, { editing_desc: false });
534534
}
535535

536+
isEditing = () => {
537+
const task_id = this.getFrameData("current_task_id");
538+
return !!this.getFrameData("local_task_state")?.getIn([
539+
task_id,
540+
"editing_desc",
541+
]);
542+
};
543+
536544
// null=unselect all.
537545
public edit_desc(task_id: string | undefined | null): void {
538546
// close any that were currently in edit state before opening new one

src/packages/frontend/editors/task-editor/keyboard.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ function is_sortable(actions): boolean {
1818
}
1919

2020
export function create_key_handler(actions): (any) => void {
21-
return function (evt) {
21+
return (evt) => {
22+
if (actions.isEditing()) {
23+
return;
24+
}
2225
const read_only = !!actions.store.get("read_only");
2326
const mod = evt.ctrlKey || evt.metaKey || evt.altKey || evt.shiftKey;
2427

0 commit comments

Comments
 (0)