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
parent
commit
ab9d1b25a1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/config/constants.js
  2. 4
      src/main/app.js

5
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)

4
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)

Loading…
Cancel
Save