refactor(ui): Simplify Escape key navigation in device route

This commit is contained in:
Adam Shiervani 2025-02-26 00:58:00 +01:00
parent 6a2443c07c
commit 0588a35fd0
1 changed files with 2 additions and 8 deletions

View File

@ -478,16 +478,10 @@ export default function KvmIdRoute() {
</div> </div>
<div <div
onKeyUp={e => { onKeyUp={e => e.stopPropagation()}
e.stopPropagation();
}}
onKeyDown={e => { onKeyDown={e => {
e.stopPropagation(); e.stopPropagation();
if (e.key === "Escape") { if (e.key === "Escape") navigate("..");
if (location.pathname !== "/other-session") {
navigate("..");
}
}
}} }}
> >
<Modal <Modal