add select all to toogle oneClicks

This commit is contained in:
MathieuG-P
2023-01-06 16:51:23 +01:00
parent 3358efac88
commit 28b6241255
7 changed files with 74 additions and 69 deletions
+9 -14
View File
@@ -166,24 +166,19 @@ export class MapsManagerService {
this.progressBar.hide(true);
}
public isDeepLinksEnabled(): Promise<boolean>{
return this.ipcService.send<boolean>("is-map-deep-links-enabled").then(res => (
res.success ? res.data : false
));
public async isDeepLinksEnabled(): Promise<boolean>{
const res = await this.ipcService.send<boolean>("is-map-deep-links-enabled");
return res.success ? res.data : false;
}
public async toogleDeepLinks(): Promise<boolean>{
const isEnabled = await this.isDeepLinksEnabled();
const channel = isEnabled ? "unregister-maps-deep-link" : "register-maps-deep-link";
const res = await this.ipcService.send<boolean>(channel);
public async enableDeepLink(): Promise<boolean>{
const res = await this.ipcService.send<boolean>("register-maps-deep-link");
return res.success ? res.data : false;
}
public async disableDeepLink(): Promise<boolean>{
const res = await this.ipcService.send<boolean>("unregister-maps-deep-link");
return res.success ? res.data : false;
}
public get versionLinked$(): Observable<BSVersion>{
@@ -21,18 +21,14 @@ export class ModelsManagerService {
));
}
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);
public async enableDeepLink(): Promise<boolean>{
const res = await this.ipc.send<boolean>("register-models-deep-link");
return res.success ? res.data : false;
}
public async disableDeepLink(): Promise<boolean>{
const res = await this.ipc.send<boolean>("unregister-models-deep-link");
return res.success ? res.data : false;
}
}
@@ -21,16 +21,14 @@ export class PlaylistsManagerService {
));
}
public async toogleDeepLinks(): Promise<boolean>{
const isEnabled = await this.isDeepLinksEnabled();
const channel = isEnabled ? "unregister-playlists-deep-link" : "register-playlists-deep-link";
const res = await this.ipc.send<boolean>(channel);
public async enableDeepLink(): Promise<boolean>{
const res = await this.ipc.send<boolean>("register-playlists-deep-link");
return res.success ? res.data : false;
}
public async disableDeepLink(): Promise<boolean>{
const res = await this.ipc.send<boolean>("unregister-playlists-deep-link");
return res.success ? res.data : false;
}
}