Skip to content

Commit fb844e0

Browse files
author
Ives van Hoorne
committed
Clean up sidebar shift flow
1 parent 12967ae commit fb844e0

File tree

1 file changed

+3
-3
lines changed
  • packages/app/src/app/pages/Sandbox/Editor

1 file changed

+3
-3
lines changed

packages/app/src/app/pages/Sandbox/Editor/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ export default class ContentSplit extends React.PureComponent<Props, State> {
3535
if (e.keyCode === 16) {
3636
if (!this.shiftPressed) {
3737
this.shiftPressed = true;
38-
if (this.timeout) {
39-
clearTimeout(this.timeout);
40-
}
4138
this.timeout = setTimeout(() => {
4239
this.shiftPressed = false;
4340
}, 500);
@@ -53,6 +50,9 @@ export default class ContentSplit extends React.PureComponent<Props, State> {
5350

5451
componentWillUnmount() {
5552
document.removeEventListener('keydown', this.handleKeyPress);
53+
if (this.timeout) {
54+
clearTimeout(this.timeout);
55+
}
5656
}
5757

5858
toggleWorkspace = () =>

0 commit comments

Comments
 (0)