fixed: 跳过崩溃问题

Change-Id: I23647786339d3b1f32211cb90186ea534ac20763
This commit is contained in:
dinglili 2024-08-05 17:28:23 +08:00 committed by wangpenglong
parent aa25abc11c
commit 4e6d8e509d
3 changed files with 35 additions and 32 deletions

View File

@ -1373,7 +1373,7 @@ export class CodeApplication extends Disposable {
private async openDeploylWindow(accessor: ServicesAccessor): Promise<void> {
const DeployMainService = accessor.get(IDeployMainService);
await new Promise((resolve, reject) => {
DeployMainService.openDeployWindow().then(() => {
DeployMainService.openDeployWindow(true).then(() => {
resolve(void 0);
}).catch((error) => {
console.log(error);

View File

@ -457,8 +457,8 @@ class deployWindow {
if (this.notNowRadio && this.notNowRadio instanceof HTMLInputElement && this.notNowRadio.checked) {
this.justDownLoadTabArrayIndex = 0;
this.localInstallTabArrayIndex = 0;
console.log('renderer send kylinide.installWizard.skipWizard');
ipcRenderer.send('kylinide.installWizard.skipWizard');
// console.log('renderer send kylinide.installWizard.skipWizard');
ipcRenderer.send('kylinide.installWizard.closeWizard', { type: "skip" });
} else if (this.onlineInstallRadio && this.onlineInstallRadio instanceof HTMLInputElement && this.onlineInstallRadio.checked) {
this.justDownLoadTabArrayIndex = 0;
this.localInstallTabArrayIndex = 0;
@ -773,10 +773,10 @@ class deployWindow {
ipcRenderer.send('kylinide.installWizard.helpLink', { type: "helpLink" })
});
document.getElementById('skipAll')?.addEventListener('click', () => {
console.log("render send kylinide.installWizard.skipWizard");
ipcRenderer.send('kylinide.installWizard.skipWizard');
});
// document.getElementById('skipAll')?.addEventListener('click', () => {
// console.log("render send kylinide.installWizard.skipWizard");
// ipcRenderer.send('kylinide.installWizard.skipWizard');
// });
this.prevBtn!.addEventListener('click', () => {
console.log('click prevStep');

View File

@ -136,9 +136,6 @@ export class DeployMainService implements IDeployMainService {
this.loggerSoft = this.loggerMainService.createLogger(URI.file(this.installConfig + "/log/softdetail.log"));
this.removeListeners();
this.registerListeners();
this.deployWindowrParentWindow?.on('close', () => {
this.deployWindowrParentWindow = null;
})
}
reset() {
this.localConfigObject = { depConfigInfo: "", res: 0, g_index_Object: {}, osinfo: "", localConfigMatch: 0, osrelease: "", supportList: [] };
@ -201,14 +198,18 @@ export class DeployMainService implements IDeployMainService {
this.logger.info("最小化窗口");
this.minWindow();
};
listenerCloseWindow = (event: IpcMainEvent) => {
listenerCloseWindow = (event: IpcMainEvent, msg: any) => {
if (msg.type === 'skip') {
this.logger.info("跳过配置");
}
if (msg.type === "close") {
//删除新下载但是没被使用的配置文件
if (this.updateConfigDir) {
if (this.selectObject.updateFlag == false)
if (fs.existsSync(this.updateConfigDir))
fs.rmdirSync(this.updateConfigDir, { recursive: true });
}
}
this.closeWindow();
};
@ -1233,23 +1234,25 @@ export class DeployMainService implements IDeployMainService {
this.DeployWindow.on('close', () => {
this.logger.info("关闭窗口");
this.DeployWindow = null;
validatedIpcMain.removeListener('kylinide.installWizard.skipWizard', listenerSkipWizard
);
// validatedIpcMain.removeListener('kylinide.installWizard.init', listenerInit);
try {
DeployDisposables.dispose();
if (flag) {
// 第一次打开时,关闭窗口,继续
} catch {
this.logger.error("deployDisposables.dispose() catch");
}
resolve(void 0);
}
});
const listenerSkipWizard = async (event: IpcMainEvent) => {
this.logger.info("跳过配置");
if (this.DeployWindow && this.DeployWindow != undefined) {
this.DeployWindow.close();
}
}
validatedIpcMain.on('kylinide.installWizard.skipWizard', listenerSkipWizard
);
this.deployWindowrParentWindow?.on('close', () => {
this.deployWindowrParentWindow = null;
})
// const listenerSkipWizard = async (event: IpcMainEvent) => {
// this.logger.info("跳过配置");
// if (this.DeployWindow && this.DeployWindow != undefined) {
// this.DeployWindow.close();
// }
// }
// validatedIpcMain.on('kylinide.installWizard.skipWizard', listenerSkipWizard
// );
}
if (this.DeployWindow) {
this.focusWindow(this.DeployWindow);