Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 8683d00

Browse files
committed
nits and comments
1 parent b3dcb3f commit 8683d00

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

frontend/PropState.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
var React = require('react');
1414
var BlurInput = require('./BlurInput');
1515
var DataView = require('./DataView/DataView');
16+
var invariant = require('./invariant');
1617

1718
var decorate = require('./decorate');
1819

@@ -146,6 +147,8 @@ var WrappedPropState = decorate({
146147
store.setState(store.selected, path.slice(1), val);
147148
} else if (path[0] === 'context') {
148149
store.setContext(store.selected, path.slice(1), val);
150+
} else {
151+
invariant(false, "the path to change() must start wth props, state, or context");
149152
}
150153
},
151154
showMenu(e, val, path, name) {
@@ -160,7 +163,8 @@ var styles = {
160163
container: {
161164
padding: 3,
162165
fontSize: '11px',
163-
fontFamily: 'Menlo, monospace',
166+
// TODO figure out what font Chrome devtools uses on Windows
167+
fontFamily: 'Menlo, Consolas, monospace',
164168
overflow: 'auto',
165169
flex: 1,
166170
display: 'flex',

frontend/PropVal.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*
99
* @flow
10-
* $FLowFixMe
11-
* - thinks all react component classes must inherit from React.Component
1210
*/
1311
'use strict';
1412

frontend/Props.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ class Props {
3434

3535
var items = [];
3636
names.slice(0, 3).forEach(name => {
37-
items.push((
37+
items.push(
3838
<span key={name} style={styles.prop}>
3939
<span style={styles.propName}>{name}</span>
4040
=
4141
<PropVal val={props[name]}/>
4242
</span>
43-
));
43+
);
4444
});
4545

4646
if (names.length > 3) {

frontend/SearchPane.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class SearchPane extends React.Component {
3535
componentDidMount() {
3636
this._key = this.onDocumentKeyDown.bind(this);
3737
var doc = React.findDOMNode(this).ownerDocument;
38+
// capture=true is needed to prevent chrome devtools console popping up
3839
doc.addEventListener('keydown', this._key, true);
3940
}
4041

@@ -65,9 +66,7 @@ class SearchPane extends React.Component {
6566

6667
cancel() {
6768
this.props.onChangeSearch('');
68-
setTimeout(() => {
69-
React.findDOMNode(this.input).blur();
70-
}, 100);
69+
React.findDOMNode(this.input).blur();
7170
}
7271

7372
onKeyDown(key) {

frontend/Store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class Store extends EventEmitter {
184184
.map(([key, val]) => key)
185185
.toList();
186186
}
187-
// $FlowFixMe
187+
// $FlowFixMe this.searchRoots is not falsey
188188
this.searchRoots.forEach(id => {
189189
if (this.hasBottom(id)) {
190190
this._nodes = this._nodes.setIn([id, 'collapsed'], true);

0 commit comments

Comments
 (0)