From 7e41ed6b004b725829f20033a71e78695d6d069e Mon Sep 17 00:00:00 2001 From: Bart Dumon Date: Sun, 11 Apr 2021 17:25:36 +0200 Subject: [PATCH] avoid server warning in case of resize --- app/libtextmode/textmode.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/libtextmode/textmode.js b/app/libtextmode/textmode.js index 2b85747..b373757 100644 --- a/app/libtextmode/textmode.js +++ b/app/libtextmode/textmode.js @@ -219,12 +219,13 @@ function resize_canvas(doc, columns, rows) { var client = false; try { const electron = require("electron"); - const win = electron.remote.getCurrentWindow(); - client = true; + if (typeof electron == "object") { + const win = electron.remote.getCurrentWindow(); + client = true; + } } catch (err) { console.log(err); } - console.log('client: ' + client); const min_rows = Math.min(doc.rows, rows); const min_columns = Math.min(doc.columns, columns); const new_data = new Array(columns * rows);