Skip to content

Commit

Permalink
fix(electron): endpoint injection
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Mar 28, 2018
1 parent d3b403d commit 39a1110
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Expand Up @@ -327,7 +327,9 @@ cd ${folderPath}; graphql playground`)

console.log('setting', { state })

this.serializeWorkspace(state)
if (endpoint) {
this.serializeWorkspace(state)
}

this.setState(state)
}
Expand Down
Expand Up @@ -180,6 +180,23 @@ class PlaygroundWrapper extends React.Component<
) {
const configIsYaml = this.isConfigYaml(nextProps.configString)
this.setState({ configIsYaml })
if (nextProps.config) {
const activeEnv = this.getInitialActiveEnv(nextProps.config)
const endpoints = getActiveEndpoints(
nextProps.config,
activeEnv.activeEnv!,
this.state.activeProjectName,
)
const endpoint = endpoints.endpoint
const subscriptionEndpoint = endpoints.subscriptionEndpoint
const headers = endpoints.headers
this.setState({
endpoint,
subscriptionEndpoint,
headers,
activeEnv: activeEnv.activeEnv,
})
}
}
}

Expand Down

0 comments on commit 39a1110

Please sign in to comment.