Skip to content

Commit c02a07e

Browse files
committed
fix electron changes
1 parent 033c877 commit c02a07e

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

app/handlers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const path = require('path');
55
const handlers = {};
66

77
handlers.layoutOpen = (callback) => {
8-
const filenames = dialog.showOpenDialog({
8+
const filenames = dialog.showOpenDialogSync({
99
filters: [
1010
{name: 'Thinreports Layout File', extensions: ['tlf']}
1111
],
@@ -32,7 +32,7 @@ handlers.layoutSave = (callback, data, attrs) => {
3232
}
3333

3434
handlers.layoutSaveAs = (callback, data) => {
35-
const filename = dialog.showSaveDialog({
35+
const filename = dialog.showSaveDialogSync({
3636
filters: [
3737
{name: 'Thinreports Layout File', extensions: ['tlf']}
3838
]
@@ -53,7 +53,7 @@ handlers.layoutSaveAs = (callback, data) => {
5353
}
5454

5555
handlers.imageOpen = (callback) => {
56-
const imagefiles = dialog.showOpenDialog({
56+
const imagefiles = dialog.showOpenDialogSync({
5757
filters: [
5858
{name: 'Images', extensions: ['jpg', 'png']}
5959
]
@@ -83,7 +83,7 @@ handlers.exportAs = (callback, type, content) => {
8383
break;
8484
}
8585

86-
const filename = dialog.showSaveDialog({
86+
const filename = dialog.showSaveDialogSync({
8787
filters: [
8888
{extensions: [extName], name: description}
8989
]

app/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ function createWindow () {
1010
win = new BrowserWindow({
1111
width: 1000,
1212
height: 700,
13-
icon: path.join(__dirname, 'assets/images/app-icon.png')
13+
icon: path.join(__dirname, 'assets/images/app-icon.png'),
14+
webPreferences: {
15+
nodeIntegration: true,
16+
enableRemoteModule: true
17+
}
1418
})
1519

1620
win.loadURL(url.format({

0 commit comments

Comments
 (0)