Skip to content

Commit

Permalink
fix: disable toggle fixed for alt + b
Browse files Browse the repository at this point in the history
  • Loading branch information
Z233 committed Oct 2, 2023
1 parent a3a6290 commit 1dfac5c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/ui/plan/PlanTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const PlanTable: FC<PlanTableProps> = (props) => {
}
}

// TODO Move to a separate file, make it more generic
const handleCellKeyDown = async (e: KeyboardEvent, rowIndex: number, columnKey: ColumnKeys) => {
switch (e.key) {
case Keys.Enter:
Expand Down Expand Up @@ -132,15 +133,11 @@ export const PlanTable: FC<PlanTableProps> = (props) => {

case Keys.B:
if (!e.altKey) return
// Begin or Unfixed Activity
if (check(data[rowIndex].f)) {
await updateCell(rowIndex, ColumnKeys.F, '')
} else {
await Promise.all([
updateCell(rowIndex, ColumnKeys.F, 'x'),
updateCell(rowIndex, ColumnKeys.Start, parseMins2Time(getNowMins())),
])
}
await Promise.all([
updateCell(rowIndex, ColumnKeys.F, 'x'),
updateCell(rowIndex, ColumnKeys.Start, parseMins2Time(getNowMins())),
])

setFocusCell({ rowIndex, columnKey })
break

Expand Down

0 comments on commit 1dfac5c

Please sign in to comment.