aboutsummaryrefslogtreecommitdiffstats
path: root/src/electron/ipc-api
diff options
context:
space:
mode:
authorLibravatar Amine Mouafik <amine@mouafik.fr>2019-11-29 01:03:19 +0700
committerLibravatar Amine Mouafik <amine@mouafik.fr>2019-11-29 01:03:19 +0700
commitd764e6e29e19c50a4e285df41289774ec80a9bbb (patch)
tree13ab73ed87ef8d061382caa0499131568ae91dd2 /src/electron/ipc-api
parentUpdate ref to latest recipes fixes (diff)
downloadferdium-app-d764e6e29e19c50a4e285df41289774ec80a9bbb.tar.gz
ferdium-app-d764e6e29e19c50a4e285df41289774ec80a9bbb.tar.zst
ferdium-app-d764e6e29e19c50a4e285df41289774ec80a9bbb.zip
Rename server to internal-server to avoid confusion
Diffstat (limited to 'src/electron/ipc-api')
-rw-r--r--src/electron/ipc-api/localServer.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/electron/ipc-api/localServer.js b/src/electron/ipc-api/localServer.js
index d12fb5708..9b800fdf6 100644
--- a/src/electron/ipc-api/localServer.js
+++ b/src/electron/ipc-api/localServer.js
@@ -1,6 +1,6 @@
1import { ipcMain, app } from 'electron'; 1import { ipcMain, app } from 'electron';
2import net from 'net'; 2import net from 'net';
3import startServer from '../../server/start'; 3import startServer from '../../internal-server/start';
4 4
5const DEFAULT_PORT = 45569; 5const DEFAULT_PORT = 45569;
6 6
@@ -31,15 +31,12 @@ export default (params) => {
31 let port = DEFAULT_PORT; 31 let port = DEFAULT_PORT;
32 (async () => { 32 (async () => {
33 // eslint-disable-next-line no-await-in-loop 33 // eslint-disable-next-line no-await-in-loop
34 while (await portInUse(port) && port < DEFAULT_PORT + 10) { 34 while ((await portInUse(port)) && port < DEFAULT_PORT + 10) {
35 port += 1; 35 port += 1;
36 } 36 }
37 console.log('Starting local server on port', port); 37 console.log('Starting local server on port', port);
38 38
39 startServer( 39 startServer(app.getPath('userData'), port);
40 app.getPath('userData'),
41 port,
42 );
43 40
44 params.mainWindow.webContents.send('localServerPort', { 41 params.mainWindow.webContents.send('localServerPort', {
45 port, 42 port,