updateElectronWindow = (results, visibleResults) => {
  const { length } = results
  const win = electronWindow
  const [width] = win.getSize()

  // When results list is empty window is not resizable
  win.setResizable(length !== 0)

  if (length === 0) {
    win.setMinimumSize(WINDOW_WIDTH, INPUT_HEIGHT)
    win.setSize(width, INPUT_HEIGHT)
    const [x, y] = config.get('winPosition')
    win.setPosition(x, y)
    return
  }

  const resultHeight = Math.max(Math.min(visibleResults, length), MIN_VISIBLE_RESULTS)
  const heightWithResults = resultHeight * RESULT_HEIGHT + INPUT_HEIGHT
  const minHeightWithResults = MIN_VISIBLE_RESULTS * RESULT_HEIGHT + INPUT_HEIGHT
  win.setMinimumSize(WINDOW_WIDTH, minHeightWithResults)
  win.setSize(width, heightWithResults)
  const [x, y] = config.get('winPosition')
  win.setPosition(x, y)
}
Set resizable and size for main electron window when results count is changed