@@ -22,6 +22,7 @@ import {
2222import { share } from '../../../state/sharing/actions'
2323import { openHistory } from '../../../state/general/actions'
2424import { getSettings } from '../../../state/workspace/reducers'
25+ import { Session } from '../../../state/sessions/reducers'
2526import { ISettings } from '../../../types'
2627
2728export interface Props {
@@ -30,6 +31,7 @@ export interface Props {
3031 fixedEndpoint ?: boolean
3132 isPollingSchema : boolean
3233 endpointUnreachable : boolean
34+ session : Session
3335
3436 editEndpoint : ( value : string ) => void
3537 prettifyQuery : ( ) => void
@@ -111,8 +113,7 @@ class TopBar extends React.Component<Props, {}> {
111113 this . props . openHistory ( )
112114 }
113115 getCurl = ( ) => {
114- // no need to rerender the whole time. only on-demand the store is fetched
115- const session = getSelectedSession ( this . context . store . getState ( ) )
116+ const session = this . props . session
116117 let variables
117118 try {
118119 variables = JSON . parse ( session . variables )
@@ -157,6 +158,7 @@ const mapStateToProps = createStructuredSelector({
157158 isPollingSchema : getIsPollingSchema ,
158159 endpointUnreachable : getEndpointUnreachable ,
159160 settings : getSettings ,
161+ session : getSelectedSession ,
160162} )
161163
162164export default connect (
0 commit comments