@@ -35,7 +35,7 @@ import RegistryConfig, {REGISTRY_READ_EVENT} from './RegistryConfig';
|
||||
export default class Config extends EventEmitter {
|
||||
configFilePath: string;
|
||||
|
||||
registryConfig?: RegistryConfig;
|
||||
registryConfig: RegistryConfig;
|
||||
|
||||
combinedData?: CombinedConfig;
|
||||
registryConfigData?: Partial<RegistryConfigType>;
|
||||
@@ -46,11 +46,12 @@ export default class Config extends EventEmitter {
|
||||
constructor(configFilePath: string) {
|
||||
super();
|
||||
this.configFilePath = configFilePath;
|
||||
this.registryConfig = new RegistryConfig();
|
||||
}
|
||||
|
||||
// separating constructor from init so main can setup event listeners
|
||||
init = (): void => {
|
||||
this.registryConfig = new RegistryConfig();
|
||||
this.reload();
|
||||
this.registryConfig.once(REGISTRY_READ_EVENT, this.loadRegistry);
|
||||
this.registryConfig.init();
|
||||
}
|
||||
|
@@ -157,6 +157,12 @@ async function initializeConfig() {
|
||||
config.on('synchronize', handleConfigSynchronize);
|
||||
config.on('darkModeChange', handleDarkModeChange);
|
||||
handleConfigUpdate(configData);
|
||||
|
||||
// can only call this before the app is ready
|
||||
if (config.enableHardwareAcceleration === false) {
|
||||
app.disableHardwareAcceleration();
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
config.init();
|
||||
@@ -194,11 +200,6 @@ function initializeBeforeAppReady() {
|
||||
process.chdir(expectedPath);
|
||||
}
|
||||
|
||||
// can only call this before the app is ready
|
||||
if (config.enableHardwareAcceleration === false) {
|
||||
app.disableHardwareAcceleration();
|
||||
}
|
||||
|
||||
refreshTrayImages(config.trayIconTheme);
|
||||
|
||||
// If there is already an instance, quit this one
|
||||
|
Reference in New Issue
Block a user