[feature-274] improve oculus downloading process

This commit is contained in:
MathieuG-P
2023-10-24 02:17:46 +02:00
parent b576a33293
commit a17da3a83f
5 changed files with 74 additions and 40 deletions
@@ -56,7 +56,7 @@ export class BsDownloaderService {
public async downloadVersion(version: BSVersion, from: BsStore): Promise<BSVersion | void> {
if(from === BsStore.STEAM){
if(from === BsStore.STEAM || !version.OculusBinaryId){
return this.steamDownloader.downloadBsVersion(version);
}
@@ -66,17 +66,15 @@ export class OculusDownloaderService {
return (async () => {
const autoDownload = await lastValueFrom(this.tryAutoDownload(version)).then(() => true).catch(() => false);
console.log("LAAAA");
if(autoDownload){
return autoDownload;
}
const [confirm, stay] = await this.modals.openModal(LoginToMetaModal).then(res => [res.exitCode === ModalExitCode.COMPLETED, res.data]);
const [completed, stay] = await this.modals.openModal(LoginToMetaModal).then(res => [res.exitCode === ModalExitCode.COMPLETED, res.data]);
if(!confirm){
return confirm;
if(!completed){
return completed;
}
return lastValueFrom(this.doDownloadBsVersion({ version, stay })).then(() => true);