From 684808664254bd352899aa8c0c17258c86a9526b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Thu, 28 Jun 2018 19:29:33 +0200 Subject: [PATCH] set app MIN_HEIGHT to 700 for lower screens --- src/config/constants.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/config/constants.js b/src/config/constants.js index 894a12ce..e0d25221 100644 --- a/src/config/constants.js +++ b/src/config/constants.js @@ -5,16 +5,17 @@ const intFromEnv = (key: string, def: number): number => { if (!isNaN(v)) return parseInt(v, 10) return def } -const boolFromEnv = (key: string): boolean => { +const boolFromEnv = (key: string, def: boolean = false): boolean => { const v = process.env[key] - return (v && v !== '0' && v !== 'false') || false + if (typeof v === 'string') return !(v === '0' || v === 'false') + return def } const stringFromEnv = (key: string, def: string): string => process.env[key] || def // Size -export const MIN_HEIGHT = intFromEnv('LEDGER_MIN_HEIGHT', 768) +export const MIN_HEIGHT = intFromEnv('LEDGER_MIN_HEIGHT', 700) export const MIN_WIDTH = intFromEnv('LEDGER_MIN_WIDTH', 1024) // time and delays...