Merge pull request #9574 from ever-co/bug/restart-app

[Bug] Restart app
This commit is contained in:
Kifungo A
2026-03-06 09:39:49 +01:00
committed by GitHub
parent 3b60502fd0
commit 2d4ca75cd7
3 changed files with 11 additions and 14 deletions
@@ -15,6 +15,7 @@ export interface DesktopSetupConfig {
portUi?: string;
host?: string;
protocol?: string;
isSetup?: boolean;
serverUrl?: string;
isLocalServer?: boolean;
postgres?: {
@@ -970,8 +970,8 @@ export class SettingsComponent implements OnInit, AfterViewInit, OnDestroy {
...this.config
};
if (this.config.timeTrackerWindow) newConfig.awHost = `http://127.0.0.1:${this.config.awPort}`;
this.electronService.ipcRenderer.send('restart_app', newConfig);
this.electronService.ipcRenderer.send('save_additional_setting', thConfig);
this.electronService.ipcRenderer.send('restart_app', newConfig);
}
portChange(val, type) {
@@ -375,28 +375,24 @@ export class SetupComponent implements OnInit, OnDestroy {
if (this.connectivity.integrated) {
this.onProgress = true;
}
const gauzyConfig: DesktopSetupConfig = {
const gauzyConfig: DesktopSetupConfig = {
...this.getServerConfig(),
...this.getDataBaseConfig(),
...this.getThirdPartyConfig(),
...this.getFeature()
...this.getFeature(),
isSetup: true
};
await this.electronService.ipcRenderer.invoke('PREFERRED_LANGUAGE', this.languageSelector.preferredLanguage);
try {
let isStarted = false;
if (this.isServer) {
this.electronService.ipcRenderer.send('start_server', gauzyConfig);
isStarted = true;
} else {
isStarted = await this.electronService.ipcRenderer.invoke('START_SERVER', gauzyConfig);
}
if (isStarted && !gauzyConfig.isLocalServer) {
if (this.isServer || this.isServerApi) {
this.electronService.ipcRenderer.send('start_server', gauzyConfig);
if (!gauzyConfig.isLocalServer) {
this.electronService.ipcRenderer.send('app_is_init');
}
} catch (error) {
this._errorHandlerService.handleError(error);
} else {
this.electronService.ipcRenderer.send('restart_app', gauzyConfig);
}
this.isSaving = false;
}