From 7a416b107b0b1cd8f60c0676b57882187e05e8ba Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 25 Dec 2019 19:38:28 +0100 Subject: [PATCH] fix electron dep issue in the server version, closes #784 --- Dockerfile | 2 +- bin/build-server.sh | 2 +- src/services/window.js | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index eaef06ef2..d6afebe95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:12.13.1-alpine +FROM node:12.14.0-alpine # Create app directory WORKDIR /usr/src/app diff --git a/bin/build-server.sh b/bin/build-server.sh index 1fa6e0b8d..b46121dc7 100755 --- a/bin/build-server.sh +++ b/bin/build-server.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash PKG_DIR=dist/trilium-linux-x64-server -NODE_VERSION=12.13.1 +NODE_VERSION=12.14.0 if [ "$1" != "DONTCOPY" ] then diff --git a/src/services/window.js b/src/services/window.js index 955e8c51d..f7fed7256 100644 --- a/src/services/window.js +++ b/src/services/window.js @@ -1,10 +1,8 @@ -const {BrowserWindow} = require('electron'); const path = require('path'); const url = require("url"); const port = require('./port'); const optionService = require('./options'); const env = require('./env'); -const windowStateKeeper = require('electron-window-state'); // Prevent window being garbage collected /** @type {Electron.BrowserWindow} */ @@ -13,12 +11,15 @@ let mainWindow; let setupWindow; async function createMainWindow() { + const windowStateKeeper = require('electron-window-state'); // should not be statically imported + const mainWindowState = windowStateKeeper({ // default window width & height so it's usable on 1600 * 900 display (including some extra panels etc.) defaultWidth: 1200, defaultHeight: 800 }); + const {BrowserWindow} = require('electron'); // should not be statically imported mainWindow = new BrowserWindow({ x: mainWindowState.x, y: mainWindowState.y, @@ -61,6 +62,7 @@ function getIcon() { } async function createSetupWindow() { + const {BrowserWindow} = require('electron'); // should not be statically imported setupWindow = new BrowserWindow({ width: 800, height: 800,