diff --git a/assets/jsons/translations/en.json b/assets/jsons/translations/en.json index 6d912f49..bda50b01 100644 --- a/assets/jsons/translations/en.json +++ b/assets/jsons/translations/en.json @@ -406,7 +406,7 @@ "oculus-download": { "errors": { "msg": { - "DOWNLOAD_MANIFEST_FAILED": "Unable to download the manifest for this version; your login token may be invalid.", + "DOWNLOAD_MANIFEST_FAILED": "Unable to download the manifest. Your login token may be invalid, or you don't own the desktop version of Beat Saber.", "MANIFEST_FILE_NOT_FOUND": "Unable to find the manifest for this version.", "PARSE_MANIFEST_FILE_FAILED": "An error occurred while reading the manifest.", "ALREADY_DOWNLOADING": "A version is already being downloaded.", diff --git a/src/renderer/components/modal/modal-types/bs-downgrade/login-to-meta-modal.component.tsx b/src/renderer/components/modal/modal-types/bs-downgrade/login-to-meta-modal.component.tsx index 161c91dd..1ee1d59a 100644 --- a/src/renderer/components/modal/modal-types/bs-downgrade/login-to-meta-modal.component.tsx +++ b/src/renderer/components/modal/modal-types/bs-downgrade/login-to-meta-modal.component.tsx @@ -60,6 +60,8 @@ export const LoginToMetaModal: ModalComponent = ({ resolver }) => {

{t("modals.connect-to-meta.body.token-needed")}

{t("modals.connect-to-meta.body.need-cookie-enabled")}

+

You must own the desktop version of Beat Saber. If you bought it on the standalone store, follow this guide to claim it.

+
setStay(() => enable)}/> {t("modals.connect-to-meta.stay")} diff --git a/src/renderer/services/bs-version-download/oculus-downloader.service.ts b/src/renderer/services/bs-version-download/oculus-downloader.service.ts index e39f3b88..dda0c3ea 100644 --- a/src/renderer/services/bs-version-download/oculus-downloader.service.ts +++ b/src/renderer/services/bs-version-download/oculus-downloader.service.ts @@ -11,6 +11,8 @@ import { AbstractBsDownloaderService } from "./abstract-bs-downloader.service"; import { MetaAuthErrorCodes, OculusDownloaderErrorCodes } from "shared/models/bs-version-download/oculus-download.model"; import { LoginToMetaModal } from "renderer/components/modal/modal-types/bs-downgrade/login-to-meta-modal.component"; import { OculusDownloadInfo } from "main/services/bs-version-download/bs-oculus-downloader.service"; +import { Notification } from "shared/models/notification/notification.model"; +import { LinkOpenerService } from "../link-opener.service"; export class OculusDownloaderService extends AbstractBsDownloaderService implements DownloaderServiceInterface{ @@ -28,6 +30,7 @@ export class OculusDownloaderService extends AbstractBsDownloaderService impleme private readonly progressBar: ProgressBarService; private readonly notifications: NotificationService; private readonly modals: ModalService; + private readonly linkOpener: LinkOpenerService; private readonly DISPLAYABLE_ERROR_CODES: string[] = [...Object.values(MetaAuthErrorCodes), ...Object.values(OculusDownloaderErrorCodes)]; @@ -37,11 +40,18 @@ export class OculusDownloaderService extends AbstractBsDownloaderService impleme this.progressBar = ProgressBarService.getInstance(); this.notifications = NotificationService.getInstance(); this.modals = ModalService.getInstance(); + this.linkOpener = LinkOpenerService.getInstance(); } private handleDownloadErrors(err: CustomError): Promise{ if(!err?.code || !this.DISPLAYABLE_ERROR_CODES.includes(err.code)){ - return this.notifications.notifyError({title: "notifications.types.error", desc: `notifications.bs-download.oculus-download.errors.msg.UNKNOWN_ERROR`}).then(noop); + return this.notifications.notifyError({title: "notifications.types.error", desc: `notifications.bs-download.oculus-download.errors.msg.UNKNOWN_ERROR`, duration: 9000}).then(noop); + } + + const notificationData: Notification = {title: "notifications.types.error", desc: `notifications.bs-download.oculus-download.errors.msg.${err.code}`, duration: 9000}; + if(err.code === OculusDownloaderErrorCodes.DOWNLOAD_MANIFEST_FAILED){ + notificationData.actions = [{ id: "0", title: "Claim your desktop version" }] + return this.notifications.notifyError(notificationData).then(action => action === "0" && this.linkOpener.open("")) } return this.notifications.notifyError({title: "notifications.types.error", desc: `notifications.bs-download.oculus-download.errors.msg.${err.code}`}).then(noop);