Skip to content

Commit

Permalink
refactor: clean up same action checker
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Mar 28, 2024
1 parent 5383199 commit 4cff39d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ui/src/entities/keys/lib/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import type { KeyAction } from '../model/types'

export function isSameAction (a: KeyAction, b: KeyAction): boolean {
let isModifiersDiffers = false
// NOTE: False positive
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
if ((a.modifiers && !b.modifiers) || (!a.modifiers && b.modifiers)) {
if (Boolean(a.modifiers) !== Boolean(b.modifiers)) {
return false
} else if (a.modifiers && b.modifiers) {
}
if (a.modifiers && b.modifiers) {
isModifiersDiffers = !(
a.modifiers.ctrl === b.modifiers.ctrl &&
a.modifiers.shift === b.modifiers.shift &&
Expand Down

0 comments on commit 4cff39d

Please sign in to comment.