<commit_before>'use strict';
const path     = require('path');
const fs       = require('fs');
const electron = require('electron');
const appMenu  = require('./menu');
const config   = require('./config');
const tray     = require('./tray');
const version  = require('./version');

const app      = electron.app;
const ipcMain  = electron.ipcMain;

require('electron-debug')();

const BrowserWindow = electron.BrowserWindow;

let mainWindow;
let isQuitting = false;

const isAlreadyRunning = app.makeSingleInstance(() => {
  if (mainWindow) {
    if (mainWindow.isMinimized()) {
      mainWindow.restore();
    }

    mainWindow.show();
  }
});

if (isAlreadyRunning) {
  app.quit();
}

function createMainWindow() {
  const lastWindowState = config.get('lastWindowState');
  const isDarkMode = config.get('darkMode');
  const userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1';
  const rammeDesktopIcon = path.join(__dirname, 'static/icon.png');
  const maxWidthValue = 550;<commit_msg>Prevent app from flashing white when in dark mode<commit_after>'use strict';
const path     = require('path');
const fs       = require('fs');
const electron = require('electron');
const appMenu  = require('./menu');
const config   = require('./config');
const tray     = require('./tray');
const version  = require('./version');

const app      = electron.app;
const ipcMain  = electron.ipcMain;

require('electron-debug')();

const BrowserWindow = electron.BrowserWindow;

let mainWindow;
let isQuitting = false;

const isAlreadyRunning = app.makeSingleInstance(() => {
  if (mainWindow) {
    if (mainWindow.isMinimized()) {
      mainWindow.restore();
    }

    mainWindow.webContents.on('did-finish-load', function() {
      setTimeout(function() {
          mainWindow.show()
      }, 60)
    })
  }
});

if (isAlreadyRunning) {
  app.quit();
}

function createMainWindow() {
  const lastWindowState = config.get('lastWindowState');
  const isDarkMode = config.get('darkMode');
  const userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1';
  const rammeDesktopIcon = path.join(__dirname, 'static/icon.png');
  const maxWidthValue = 550;
{'fraction_non_alphanumeric': 0.1485148514851485, 'fraction_numerical': 0.02152389151958674, 'mean_word_length': 4.019438444924406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1381377', 'n_tokens_mistral': 763, 'n_tokens_neox': 713, 'n_words': 179}