mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
deep-links models fully work AND add translations
This commit is contained in:
@@ -23,7 +23,7 @@ export class ModelDownloaderService {
|
||||
|
||||
public async oneClickInstallModel(model: MSModel): Promise<boolean>{
|
||||
|
||||
this.progress.showFake(0.07);
|
||||
this.progress.showFake(0.04);
|
||||
|
||||
const res = await this.ipc.send("one-click-install-model", {args: model});
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
import { IpcService } from "./ipc.service";
|
||||
|
||||
export class ModelsManagerService {
|
||||
|
||||
private static instance: ModelsManagerService;
|
||||
|
||||
public static getInstance(): ModelsManagerService{
|
||||
if(!ModelsManagerService.instance){ ModelsManagerService.instance = new ModelsManagerService(); }
|
||||
return ModelsManagerService.instance;
|
||||
}
|
||||
|
||||
private readonly ipc: IpcService;
|
||||
|
||||
private constructor(){
|
||||
this.ipc = IpcService.getInstance();
|
||||
}
|
||||
|
||||
public isDeepLinksEnabled(): Promise<boolean>{
|
||||
return this.ipc.send<boolean>("is-models-deep-links-enabled").then(res => (
|
||||
res.success ? res.data : false
|
||||
));
|
||||
}
|
||||
|
||||
public async toogleDeepLinks(): Promise<boolean>{
|
||||
|
||||
const isEnabled = await this.isDeepLinksEnabled();
|
||||
|
||||
const channel = isEnabled ? "unregister-models-deep-link" : "register-models-deep-link";
|
||||
|
||||
const res = await this.ipc.send<boolean>(channel);
|
||||
|
||||
return res.success ? res.data : false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user