mirror of
https://github.com/ever-co/ever-gauzy.git
synced 2026-10-02 01:54:50 +08:00
Merge pull request #9574 from ever-co/bug/restart-app
[Bug] Restart app
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user