handle enable and disable map deep links

This commit is contained in:
MathieuG-P
2022-12-17 01:24:37 +01:00
parent ca5c86dbf1
commit c626b850c9
6 changed files with 115 additions and 21 deletions
+18 -2
View File
@@ -159,8 +159,24 @@ export class MapsManagerService {
this.progressBar.hide(true);
}
public async enableDeepLink(): Promise<boolean>{
return true; // TODO
public isDeepLinksEnabled(): Promise<boolean>{
return this.ipcService.send<boolean>("is-map-deep-links-enabled").then(res => (
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);
return res.success ? res.data : false;
}
public get versionLinked$(): Observable<BSVersion>{