File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
frontends/web/src/routes/account/send Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -166,9 +166,7 @@ class Send extends Component<Props, State> {
166
166
}
167
167
} ) ,
168
168
] ;
169
- }
170
169
171
- public UNSAFE_componentWillMount ( ) {
172
170
this . registerEvents ( ) ;
173
171
}
174
172
@@ -177,16 +175,11 @@ class Send extends Component<Props, State> {
177
175
unsubscribe ( this . unsubscribeList ) ;
178
176
}
179
177
180
- private registerEvents = ( ) => {
181
- document . addEventListener ( 'keydown' , this . handleKeyDown ) ;
182
- } ;
183
-
184
- private unregisterEvents = ( ) => {
185
- document . removeEventListener ( 'keydown' , this . handleKeyDown ) ;
186
- } ;
178
+ private registerEvents = ( ) => document . addEventListener ( 'keydown' , this . handleKeyDown ) ;
179
+ private unregisterEvents = ( ) => document . removeEventListener ( 'keydown' , this . handleKeyDown ) ;
187
180
188
181
private handleKeyDown = ( e : KeyboardEvent ) => {
189
- if ( e . keyCode === 27 && ! this . state . activeCoinControl && ! this . state . activeScanQR ) {
182
+ if ( e . key === 'Escape' && ! this . state . activeCoinControl && ! this . state . activeScanQR ) {
190
183
route ( `/account/${ this . props . code } ` ) ;
191
184
}
192
185
} ;
You can’t perform that action at this time.
0 commit comments