@@ -27,16 +27,21 @@ const TabContentContainer = styled.div`
2727` ;
2828
2929const SendPageKeyboardShortcuts = ( props : {
30- onMoveSelection : ( distance : number ) => void
30+ onMoveSelection : ( distance : number ) => void ,
31+ onAbortRequest ?: ( ) => void
3132} ) => {
32- useHotkeys ( 'Ctrl+Tab, Cmd+Tab' , ( event ) => {
33+ useHotkeys ( 'Ctrl+Tab, Cmd+Tab' , ( ) => {
3334 props . onMoveSelection ( 1 ) ;
3435 } , [ props . onMoveSelection ] ) ;
3536
36- useHotkeys ( 'Ctrl+Shift+Tab, Cmd+Shift+Tab' , ( event ) => {
37+ useHotkeys ( 'Ctrl+Shift+Tab, Cmd+Shift+Tab' , ( ) => {
3738 props . onMoveSelection ( - 1 ) ;
3839 } , [ props . onMoveSelection ] ) ;
3940
41+ useHotkeys ( 'Escape' , ( ) => {
42+ if ( props . onAbortRequest ) props . onAbortRequest ( ) ;
43+ } , [ props . onAbortRequest ] )
44+
4045 return null ;
4146} ;
4247
@@ -84,6 +89,7 @@ export class SendPage extends React.Component<{
8489
8590 < SendPageKeyboardShortcuts
8691 onMoveSelection = { moveSelection }
92+ onAbortRequest = { selectedRequest ?. pendingSend ?. abort }
8793 />
8894
8995 < TabContentContainer
0 commit comments