diff --git a/browser/main/Main.js b/browser/main/Main.js
index c0aa045f..90a18a47 100644
--- a/browser/main/Main.js
+++ b/browser/main/Main.js
@@ -89,7 +89,8 @@ class Main extends React.Component {
'dispatch',
'repositories',
'config',
- 'params'
+ 'params',
+ 'location'
])}
/>
{
- let { dispatch } = this.props
+ let { dispatch, location } = this.props
+ let { router } = this.context
dispatch({
type: 'ADD_NOTE',
repository: repositoryKey,
note: note
})
+
+ router.push({
+ pathname: location.pathname,
+ query: {
+ key: `${note._repository.key}-${note.key}`
+ }
+ })
})
.catch((err) => {
console.error(err)
@@ -139,6 +147,12 @@ class TopBar extends React.Component {
}
}
+TopBar.contextTypes = {
+ router: PropTypes.shape({
+ push: PropTypes.func
+ })
+}
+
TopBar.propTypes = {
dispatch: PropTypes.func,
config: PropTypes.shape({