Skip to content

Commit

Permalink
GEN-764 | Catch errors in debug dialog shortcut effect (#2795)
Browse files Browse the repository at this point in the history
<!--
PR title: GRW-123 / Feature / Awesome new thing
-->

## Describe your changes

Avoid error when checking shortcut for debug dialog

Source: https://datadoghq.eu/rum/[email protected]:d86e86d8-8d9a-4b00-a2cb-10b8d7671fa2&issueId=00c44958-2246-11ee-83d3-da7ad0900005&from_ts=1689590266557&to_ts=1689593866557&live=true

<!--
What changes are made?
If there are many changes, a list might be a good format.
If it makes sense, add screenshots and/or screen recordings here.
-->

## Justify why they are needed

- We don't want uncaught exceptions

- I decided to log an error if the code would still contain some issues

## Checklist before requesting a review

- [ ] I have performed a self-review of my code
  • Loading branch information
robinandeer committed Jul 17, 2023
1 parent 18372e8 commit 243b46a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/store/src/components/DebugDialog/DebugDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export const DebugDialog = (props: { children: ReactNode }) => {

useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
const ctrl = event.getModifierState('Control')
if (ctrl && event.key === 'd') {
if (event.ctrlKey && event.key === 'd') {
datadogRum.addAction('open debug-dialog')
setOpen(true)
}
Expand Down

1 comment on commit 243b46a

@vercel
Copy link

@vercel vercel bot commented on 243b46a Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.