From b91be280d96740d736f5930b039042a9000a7c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Mon, 25 Jun 2018 21:18:18 +0200 Subject: [PATCH] Define app min size in constants so we can override by env --- src/config/constants.js | 5 +++++ src/main/app.js | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/config/constants.js b/src/config/constants.js index c63ff2f8..73ebe76d 100644 --- a/src/config/constants.js +++ b/src/config/constants.js @@ -12,6 +12,11 @@ const boolFromEnv = (key: string): boolean => { const stringFromEnv = (key: string, def: string): string => process.env[key] || def +// Size + +export const MIN_HEIGHT = intFromEnv('LEDGER_MIN_HEIGHT', 768) +export const MIN_WIDTH = intFromEnv('LEDGER_MIN_WIDTH', 1024) + // time and delays... export const GET_CALLS_TIMEOUT = intFromEnv('GET_CALLS_TIMEOUT', 30 * 1000) diff --git a/src/main/app.js b/src/main/app.js index 116a4307..65a224ac 100644 --- a/src/main/app.js +++ b/src/main/app.js @@ -2,6 +2,7 @@ import { app, BrowserWindow, Menu, screen } from 'electron' import debounce from 'lodash/debounce' +import { MIN_HEIGHT, MIN_WIDTH } from 'config/constants' import menu from 'main/menu' import db from 'helpers/db' @@ -67,9 +68,6 @@ const defaultWindowOptions = { } function createMainWindow() { - const MIN_HEIGHT = 768 - const MIN_WIDTH = 1024 - const savedDimensions = db.getIn('settings', 'window.MainWindow.dimensions', {}) const savedPositions = db.getIn('settings', 'window.MainWindow.positions', null)