Skip to content

Commit

Permalink
Fix missing window select on extensions (#40)
Browse files Browse the repository at this point in the history
* Fix clicking extensions not selecting window

* Remove console log
  • Loading branch information
MichaelKim authored and fg123 committed Nov 23, 2018
1 parent b4c23fd commit a42f2a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/mercury/components/root.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type StateProps = {|
|};

type DispatchProps = {|
+selectWindowDirect: number => void,
+selectWorkspace: number => void,
+selectWindow: number => void,
+killScript: number => void,
Expand Down Expand Up @@ -85,6 +86,9 @@ class Root extends React.Component<Props> {
case 'writeFile':
this.props.createOrModifyFile(message.path, message.content);
break;
case 'selectWindow':
this.props.selectWindowDirect(Number(message.id));
break;
}
}

Expand All @@ -98,6 +102,11 @@ const mapStateToProps = (state: StoreState): StateProps => ({
});

const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({
selectWindowDirect: (id: number) =>
dispatch({
type: 'SELECT_WINDOW',
id
}),
selectWorkspace: (direction: number) =>
dispatch({
type: 'INTENT_SELECT_WORKSPACE',
Expand Down
4 changes: 4 additions & 0 deletions src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ export type ExtensionMessage =
+type: 'writeFile',
+path: string,
+content: string
|}
| {|
+type: 'selectWindow',
+id: string
|};

// Response message from Mercury to extension
Expand Down

0 comments on commit a42f2a7

Please sign in to comment.