mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Merge pull request #905 from KiranNiranjan/SDA-1859
fix: SDA-1859 (Update the config logic & Hide menu items instead of disabling it)
This commit is contained in:
commit
f5f2058500
@ -7,7 +7,6 @@ import { buildNumber } from '../../package.json';
|
||||
import { isDevEnv, isElectronQA, isLinux, isMac } from '../common/env';
|
||||
import { logger } from '../common/logger';
|
||||
import { filterOutSelectedValues, pick } from '../common/utils';
|
||||
import { getDefaultUserConfig } from './config-utils';
|
||||
|
||||
const writeFile = util.promisify(fs.writeFile);
|
||||
|
||||
@ -307,8 +306,9 @@ class Config {
|
||||
if (!fs.existsSync(this.userConfigPath)) {
|
||||
// Need to wait until app ready event to access user data
|
||||
await app.whenReady();
|
||||
await this.readGlobalConfig();
|
||||
logger.info(`config-handler: user config doesn't exist! will create new one and update config`);
|
||||
await this.updateUserConfig({ configVersion: app.getVersion().toString(), buildNumber, ...getDefaultUserConfig() } as IConfig);
|
||||
await this.updateUserConfig({ configVersion: app.getVersion().toString(), buildNumber, ...this.globalConfig } as IConfig);
|
||||
}
|
||||
this.userConfig = this.parseConfigData(fs.readFileSync(this.userConfigPath, 'utf8'));
|
||||
logger.info(`config-handler: User configuration: `, this.userConfig);
|
||||
|
@ -1,40 +0,0 @@
|
||||
/**
|
||||
* Returns the default user config data
|
||||
*/
|
||||
import { CloudConfigDataTypes, IConfig } from './config-handler';
|
||||
|
||||
export const getDefaultUserConfig = (): IConfig => {
|
||||
return {
|
||||
minimizeOnClose: CloudConfigDataTypes.ENABLED,
|
||||
launchOnStartup: CloudConfigDataTypes.ENABLED,
|
||||
alwaysOnTop: CloudConfigDataTypes.DISABLED,
|
||||
bringToFront: CloudConfigDataTypes.DISABLED,
|
||||
whitelistUrl: '*',
|
||||
isCustomTitleBar: CloudConfigDataTypes.ENABLED,
|
||||
memoryRefresh: CloudConfigDataTypes.ENABLED,
|
||||
memoryThreshold: '800',
|
||||
disableGpu: false,
|
||||
devToolsEnabled: true,
|
||||
ctWhitelist: [],
|
||||
podWhitelist: [],
|
||||
notificationSettings: {
|
||||
position: 'upper-right',
|
||||
display: '',
|
||||
},
|
||||
customFlags: {
|
||||
authServerWhitelist: '',
|
||||
authNegotiateDelegateWhitelist: '',
|
||||
disableThrottling: false,
|
||||
},
|
||||
permissions: {
|
||||
media: true,
|
||||
geolocation: true,
|
||||
notifications: true,
|
||||
midiSysex: true,
|
||||
pointerLock: true,
|
||||
fullscreen: true,
|
||||
openExternal: true,
|
||||
},
|
||||
autoLaunchPath: '',
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user