Skip to content

Commit e2bcd68

Browse files
committed
minor fixes
1 parent c4a4d3d commit e2bcd68

File tree

6 files changed

+16
-19
lines changed

6 files changed

+16
-19
lines changed

packages/graphql-playground-electron/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"homepage": "https://github.com/graphcool/graphql-playground",
55
"repository": "graphcool/graphql-playground",
66
"description": "GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration)",
7-
"version": "1.5.1",
7+
"version": "1.5.2",
88
"author": {
99
"name": "Graphcool",
1010
"email": "[email protected]",
@@ -97,7 +97,7 @@
9797
"graphql-config": "^2.0.1",
9898
"graphql-config-extension-graphcool": "1.0.8",
9999
"graphql-config-extension-prisma": "0.0.9",
100-
"graphql-playground-react": "1.5.12",
100+
"graphql-playground-react": "1.5.13",
101101
"immutable": "4.0.0-rc.9",
102102
"js-yaml": "^3.10.0",
103103
"lodash.merge": "^4.6.0",

packages/graphql-playground-electron/src/main/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ ipcMain.on('cwd', (event, msg) => {
9393
windowContext.windowByPath.set(cwd, window)
9494
})
9595

96-
ipcMain.on('CloseWindow', () => app.quit())
96+
ipcMain.on('CloseWindow', (event, msg) => {
97+
const { id } = JSON.parse(msg)
98+
const window = windowContext.windowById.get(id)
99+
window.close()
100+
})
97101

98102
// This method will be called when Electron has finished
99103
// initialization and is ready to create browser windows.

packages/graphql-playground-electron/src/renderer/components/App.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,9 @@ class App extends React.Component<ReduxProps, State> {
140140
const envPath = path.join(folderPath, '.env')
141141
let env = process.env
142142
if (fs.existsSync(envPath)) {
143-
console.log('calling dotenv with ', envPath)
144143
const envString = fs.readFileSync(envPath)
145144
const localEnv = dotenv.parse(envString)
146145
if (localEnv) {
147-
console.log('merging', localEnv)
148146
env = merge(env, localEnv)
149147
}
150148
}
@@ -353,8 +351,6 @@ class App extends React.Component<ReduxProps, State> {
353351
platformToken,
354352
}
355353

356-
console.log('setting', { state })
357-
358354
if (endpoint) {
359355
this.props.selectAppHistoryItem(merge(state, {
360356
type: 'endpoint',
@@ -545,7 +541,10 @@ class App extends React.Component<ReduxProps, State> {
545541
break
546542
case 'Close':
547543
if (!this.state.endpoint && !this.state.config) {
548-
ipcRenderer.send('CloseWindow')
544+
ipcRenderer.send(
545+
'CloseWindow',
546+
JSON.stringify({ id: remote.getCurrentWindow().id }),
547+
)
549548
} else {
550549
this.closeTab()
551550
}

packages/graphql-playground-electron/src/renderer/components/InitialView/InitialView.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const modalStyle = {
5757
class InitialView extends React.Component<Props & StateFromProps, State> {
5858
state = {
5959
endpoint: '',
60-
selectedMode: 'url endpoint',
60+
selectedMode: 'local',
6161
}
6262

6363
handleRequestClose = () => null
@@ -92,12 +92,6 @@ class InitialView extends React.Component<Props & StateFromProps, State> {
9292
alert('No .graphqlconfig found in this folder')
9393
return
9494
}
95-
this.props.selectHistory(
96-
new AppHistoryItem({
97-
type: 'local',
98-
path,
99-
}),
100-
)
10195
this.setState({ endpoint: path } as State)
10296
this.props.onSelectFolder(path)
10397
}

packages/graphql-playground-electron/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3707,9 +3707,9 @@ [email protected]:
37073707
dependencies:
37083708
graphql-config "2.0.0"
37093709

3710-
3711-
version "1.5.12"
3712-
resolved "https://registry.yarnpkg.com/graphql-playground-react/-/graphql-playground-react-1.5.12.tgz#b60650d5a57a699bf542d84a364b81a711b0885d"
3710+
3711+
version "1.5.13"
3712+
resolved "https://registry.yarnpkg.com/graphql-playground-react/-/graphql-playground-react-1.5.13.tgz#28aa10f0342a824102f5d68081a99a0750c9a41d"
37133713
dependencies:
37143714
apollo-link "^1.0.7"
37153715
apollo-link-http "^1.3.2"

packages/graphql-playground-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-playground-react",
3-
"version": "1.5.12",
3+
"version": "1.5.13",
44
"main": "./lib/lib.js",
55
"typings": "./lib/lib.d.ts",
66
"description": "GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).",

0 commit comments

Comments
 (0)