mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-20 22:14:11 +00:00
fix(web): guard e.key before toLowerCase in chat keydown handler
When a keydown event fires with e.key === undefined (e.g. from synthetic events via browser extensions, accessibility tools, or IME compositions), calling e.key.toLowerCase() throws an unhandled TypeError. Add optional chaining so e.key?.toLowerCase() safely returns undefined when e.key is absent, causing the if-condition to evaluate to false and the handler to skip gracefully. Fixes Sentry issue CONSUMER-APP-19V. Co-authored-by: Dhravya Shah <dhravya@supermemory.com>
This commit is contained in:
parent
a787041ca7
commit
8cedfd2883
1 changed files with 1 additions and 1 deletions
|
|
@ -1229,7 +1229,7 @@ export function ChatSidebar({
|
|||
activeElement?.closest('[contenteditable="true"]')
|
||||
|
||||
if (
|
||||
e.key.toLowerCase() === "t" &&
|
||||
e.key?.toLowerCase() === "t" &&
|
||||
!e.metaKey &&
|
||||
!e.ctrlKey &&
|
||||
!e.altKey &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue