Browse Source
Merge pull request #700 from gre/app-size-in-constants
Define app min size in constants so we can override by env
master
Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
3 deletions
-
src/config/constants.js
-
src/main/app.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) |
|
|
|
|
|
@ -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) |
|
|
|
|
|
|
|