Skip to content

Commit

Permalink
fix: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rickimoore committed Jul 3, 2023
1 parent 9813d99 commit b8dd9bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/DeviceSelect/DeviceSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ const DeviceSelect: FC<DeviceSelectProps> = ({ devices, value, uiMode, type }) =
}
const toggleDropdown = () => toggle((prevState) => !prevState)

const confirmDelete = (deviceKey: string) => setTargetKey(deviceKey)
const confirmDelete = (e: MouseEvent<HTMLElement>, deviceKey: string) => {
e.stopPropagation()
setTargetKey(deviceKey)
}
const closeConfirm = () => setTargetKey('')

const deleteDevice = () => {
Expand Down Expand Up @@ -125,10 +128,7 @@ const DeviceSelect: FC<DeviceSelectProps> = ({ devices, value, uiMode, type }) =
{deviceKey}
</Typography>
<i
onClick={(e: MouseEvent<HTMLElement>) => {
e.stopPropagation()
confirmDelete(deviceKey)
}}
onClick={(e) => confirmDelete(e, deviceKey)}
className='bi bi-trash-fill hidden group-hover:block'
/>
{isLocked && <i className='bi bi-lock group-hover:hidden' />}
Expand Down

0 comments on commit b8dd9bc

Please sign in to comment.