[feature-274] handle irrelevant oculus download errors

Ignore errors such as "no token" when auto download or "window closed by user" in the ui
This commit is contained in:
MathieuG-P
2023-10-27 20:11:16 +02:00
parent 0a1e1efcd9
commit 43bf822aee
13 changed files with 120 additions and 43 deletions
@@ -11,6 +11,7 @@ import { useService } from "renderer/hooks/use-service.hook";
import { BSVersion } from "shared/bs-version.interface";
import { useObservable } from "renderer/hooks/use-observable.hook";
import { BsDownloaderService } from "renderer/services/bs-version-download/bs-downloader.service";
import { BsStore } from "shared/models/bs-store.enum";
export const AvailableVersionsContext = createContext<{ selectedVersion: BSVersion; setSelectedVersion: (version: BSVersion) => void }>(null);
@@ -27,7 +28,10 @@ export function AvailableVersionsList() {
const startDownload = async () => {
const store = bsDownloader.getLastStoreDownloadedFrom() ?? await bsDownloader.chooseStoreToDownloadFrom().catch(() => null);
const store = await (async () => {
if(!selectedVersion.OculusBinaryId) { return BsStore.STEAM; }
return bsDownloader.getLastStoreDownloadedFrom() ?? await bsDownloader.chooseStoreToDownloadFrom().catch(() => null);
})();
if(!store){ return; }