add modal for uninstall all mods

This commit is contained in:
MathieuG-P
2022-10-04 02:16:55 +02:00
parent 4702f67767
commit 4e7865e312
7 changed files with 55 additions and 6 deletions
@@ -53,9 +53,12 @@ export class BsModsManagerService {
});
}
public async uninstallMod(mod: Mod, version: BSVersion){
if(!this.progressBar.require()){ return; }
const modalRes = await this.modals.openModal(ModalType.UNINSTALL_MOD, mod);
if(modalRes.exitCode !== ModalExitCode.COMPLETED || !this.progressBar.require()){ return; }
if(modalRes.exitCode !== ModalExitCode.COMPLETED){ return; }
const progress$ = this.ipcService.watch<ModInstallProgression>("mod-uninstalled").pipe(map(res => res.data.progression));
this.progressBar.show(progress$, true, {paddingLeft: "190px", paddingRight: "190px", bottom: "20px"});
@@ -69,7 +72,11 @@ export class BsModsManagerService {
public async uninstallAllMods(version: BSVersion){
//TODO MODAL
if(!this.progressBar.require()){ return; }
const modalRes = await this.modals.openModal(ModalType.UNINSTALL_ALL_MODS, version);
if(modalRes.exitCode !== ModalExitCode.COMPLETED){ return; }
const progress$ = this.ipcService.watch<ModInstallProgression>("mod-uninstalled").pipe(map(res => res.data.progression));
this.progressBar.show(progress$, true, {paddingLeft: "190px", paddingRight: "190px", bottom: "20px"});
+2 -1
View File
@@ -57,7 +57,8 @@ export const enum ModalType {
INSTALLATION_FOLDER = "INSTALLATION_FOLDER",
EDIT_VERSION = "EDIT_VERSION",
CLONE_VERSION = "CLONE_VERSION",
UNINSTALL_MOD = "UNINSTALL_MOD"
UNINSTALL_MOD = "UNINSTALL_MOD",
UNINSTALL_ALL_MODS = "UNINSTALL_ALL_MODS",
}
export const enum ModalExitCode {