Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Apr 2, 2018
1 parent c4a4d3d commit e2bcd68
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/graphql-playground-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"homepage": "https://github.com/graphcool/graphql-playground",
"repository": "graphcool/graphql-playground",
"description": "GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration)",
"version": "1.5.1",
"version": "1.5.2",
"author": {
"name": "Graphcool",
"email": "[email protected]",
Expand Down Expand Up @@ -97,7 +97,7 @@
"graphql-config": "^2.0.1",
"graphql-config-extension-graphcool": "1.0.8",
"graphql-config-extension-prisma": "0.0.9",
"graphql-playground-react": "1.5.12",
"graphql-playground-react": "1.5.13",
"immutable": "4.0.0-rc.9",
"js-yaml": "^3.10.0",
"lodash.merge": "^4.6.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/graphql-playground-electron/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ ipcMain.on('cwd', (event, msg) => {
windowContext.windowByPath.set(cwd, window)
})

ipcMain.on('CloseWindow', () => app.quit())
ipcMain.on('CloseWindow', (event, msg) => {
const { id } = JSON.parse(msg)
const window = windowContext.windowById.get(id)
window.close()
})

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,9 @@ class App extends React.Component<ReduxProps, State> {
const envPath = path.join(folderPath, '.env')
let env = process.env
if (fs.existsSync(envPath)) {
console.log('calling dotenv with ', envPath)
const envString = fs.readFileSync(envPath)
const localEnv = dotenv.parse(envString)
if (localEnv) {
console.log('merging', localEnv)
env = merge(env, localEnv)
}
}
Expand Down Expand Up @@ -353,8 +351,6 @@ class App extends React.Component<ReduxProps, State> {
platformToken,
}

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

if (endpoint) {
this.props.selectAppHistoryItem(merge(state, {
type: 'endpoint',
Expand Down Expand Up @@ -545,7 +541,10 @@ class App extends React.Component<ReduxProps, State> {
break
case 'Close':
if (!this.state.endpoint && !this.state.config) {
ipcRenderer.send('CloseWindow')
ipcRenderer.send(
'CloseWindow',
JSON.stringify({ id: remote.getCurrentWindow().id }),
)
} else {
this.closeTab()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const modalStyle = {
class InitialView extends React.Component<Props & StateFromProps, State> {
state = {
endpoint: '',
selectedMode: 'url endpoint',
selectedMode: 'local',
}

handleRequestClose = () => null
Expand Down Expand Up @@ -92,12 +92,6 @@ class InitialView extends React.Component<Props & StateFromProps, State> {
alert('No .graphqlconfig found in this folder')
return
}
this.props.selectHistory(
new AppHistoryItem({
type: 'local',
path,
}),
)
this.setState({ endpoint: path } as State)
this.props.onSelectFolder(path)
}
Expand Down
6 changes: 3 additions & 3 deletions packages/graphql-playground-electron/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3707,9 +3707,9 @@ [email protected]:
dependencies:
graphql-config "2.0.0"

[email protected].12:
version "1.5.12"
resolved "https://registry.yarnpkg.com/graphql-playground-react/-/graphql-playground-react-1.5.12.tgz#b60650d5a57a699bf542d84a364b81a711b0885d"
[email protected].13:
version "1.5.13"
resolved "https://registry.yarnpkg.com/graphql-playground-react/-/graphql-playground-react-1.5.13.tgz#28aa10f0342a824102f5d68081a99a0750c9a41d"
dependencies:
apollo-link "^1.0.7"
apollo-link-http "^1.3.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-playground-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphql-playground-react",
"version": "1.5.12",
"version": "1.5.13",
"main": "./lib/lib.js",
"typings": "./lib/lib.d.ts",
"description": "GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).",
Expand Down

0 comments on commit e2bcd68

Please sign in to comment.