mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
delete deprecated function
This commit is contained in:
@@ -121,7 +121,7 @@ export class BSLocalVersionService{
|
||||
public async deleteVersion(version: BSVersion): Promise<boolean>{
|
||||
if(version.steam){ return false; }
|
||||
const versionFolder = await this.getVersionPath(version);
|
||||
if(!this.utilsService.folderExist(versionFolder)){ return true; }
|
||||
if(!this.utilsService.pathExist(versionFolder)){ return true; }
|
||||
|
||||
return this.utilsService.deleteFolder(versionFolder)
|
||||
.then(() => { return true; })
|
||||
|
||||
@@ -5,6 +5,7 @@ import path from "path";
|
||||
import { BrowserWindow } from "electron";
|
||||
import { rm } from "fs/promises";
|
||||
import { IpcResponse } from "shared/models/ipc";
|
||||
import log from "electron-log";
|
||||
|
||||
export class UtilsService{
|
||||
|
||||
@@ -29,13 +30,10 @@ export class UtilsService{
|
||||
|
||||
public setMainWindow(win: BrowserWindow){ this.mainWindow = win; }
|
||||
|
||||
//à supprimer
|
||||
public folderExist(path: string): boolean{ return existsSync(path); }
|
||||
|
||||
public pathExist(path: string): boolean{ return existsSync(path); }
|
||||
|
||||
public createFolderIfNotExist(path: string): void{
|
||||
if(!this.folderExist(path)){ mkdirSync(path, {recursive: true}); }
|
||||
if(!this.pathExist(path)){ mkdirSync(path, {recursive: true}); }
|
||||
}
|
||||
|
||||
public taskRunning(task: string): boolean{
|
||||
@@ -69,7 +67,11 @@ export class UtilsService{
|
||||
}
|
||||
|
||||
public ipcSend(channel: string, response: IpcResponse<any>): void{
|
||||
this.mainWindow.webContents.send(channel, response);
|
||||
try {
|
||||
this.mainWindow.webContents.send(channel, response);
|
||||
} catch (error) {
|
||||
log.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user