<commit_before>// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {BrowserWindow} from 'electron';
import log from 'electron-log';

import {getLocalPreload, getLocalURLString} from '../utils';

export function createSettingsWindow(mainWindow, config, withDevTools) {
    const preload = getLocalPreload('mainWindow.js');
    const spellcheck = (typeof config.useSpellChecker === 'undefined' ? true : config.useSpellChecker);
    const settingsWindow = new BrowserWindow({
        ...config.data,
        parent: mainWindow,
        title: 'Desktop App Settings',
        webPreferences: {
            nodeIntegration: false,
            contextIsolation: true,
            preload,
            spellcheck,
            enableRemoteModule: process.env.NODE_ENV === 'test',
        }});
    const localURL = getLocalURLString('settings.html');
    settingsWindow.loadURL(localURL).catch(
        (reason) => {
            log.error(`Settings window failed to load: ${reason}`);
            log.info(process.env);
        });
    settingsWindow.show();

    if (withDevTools) {
        settingsWindow.webContents.openDevTools({mode: 'detach'});
    }
    return settingsWindow;
}<commit_msg>[mm-34528] hide menu bar (#1530)<commit_after>// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {BrowserWindow} from 'electron';
import log from 'electron-log';

import {getLocalPreload, getLocalURLString} from '../utils';

export function createSettingsWindow(mainWindow, config, withDevTools) {
    const preload = getLocalPreload('mainWindow.js');
    const spellcheck = (typeof config.useSpellChecker === 'undefined' ? true : config.useSpellChecker);
    const settingsWindow = new BrowserWindow({
        ...config.data,
        parent: mainWindow,
        title: 'Desktop App Settings',
        webPreferences: {
            nodeIntegration: false,
            contextIsolation: true,
            preload,
            spellcheck,
            enableRemoteModule: process.env.NODE_ENV === 'test',
        }});
    const localURL = getLocalURLString('settings.html');
    settingsWindow.setMenuBarVisibility(false);
    settingsWindow.loadURL(localURL).catch(
        (reason) => {
            log.error(`Settings window failed to load: ${reason}`);
            log.info(process.env);
        });
    settingsWindow.show();

    if (withDevTools) {
        settingsWindow.webContents.openDevTools({mode: 'detach'});
    }
    return settingsWindow;
}
{'fraction_non_alphanumeric': 0.11865063978286157, 'fraction_numerical': 0.006591702210158977, 'mean_word_length': 2.9814814814814814, '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': '6594141', 'n_tokens_mistral': 709, 'n_tokens_neox': 691, 'n_words': 169}