mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
Merge pull request #284 from Zagrios/hotfix/nothing-happens-launch-unexisting-version-from-shortcut
[hotflix] fix nothing happens when launching a version from shortcut that no longer exist
This commit is contained in:
@@ -51,7 +51,7 @@ export class BSLauncherService {
|
||||
this.bsmProtocolService.on("launch", link => {
|
||||
log.info("Launch from bsm protocol", link.toString());
|
||||
const shortcutParams = objectFromEntries(link.searchParams.entries()) as ShortcutParams;
|
||||
this.openShortcutLaunchWindow(shortcutParams);
|
||||
this.openShortcutLaunchWindow(shortcutParams).catch(log.error);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -293,12 +293,18 @@ export class BSLauncherService {
|
||||
private async openShortcutLaunchWindow(launchOptions: ShortcutParams): Promise<void>{
|
||||
const launchOption = this.shortcutParamsToLaunchOption(launchOptions);
|
||||
|
||||
const bsPath = await this.localVersionService.getInstalledVersionPath(launchOption.version);
|
||||
const bsPath: string = await (async () => {
|
||||
const bsPath = await this.localVersionService.getInstalledVersionPath(launchOption.version);
|
||||
return bsPath ?? this.localVersionService.getVersionPath(launchOption.version);
|
||||
})().catch(e => {
|
||||
log.error(e);
|
||||
return null;
|
||||
});
|
||||
|
||||
launchOption.version = await this.localVersionService.getVersionOfBSFolder(bsPath, {
|
||||
launchOption.version = (await this.localVersionService.getVersionOfBSFolder(bsPath, {
|
||||
steam: launchOption.version.steam,
|
||||
oculus: launchOption.version.oculus,
|
||||
});
|
||||
})) ?? launchOption.version;
|
||||
|
||||
launchOption.version = {...(await this.remoteVersion.getVersionDetails(launchOption.version.BSVersion)), ...launchOption.version};
|
||||
|
||||
|
||||
@@ -84,6 +84,9 @@ export class BSLocalVersionService {
|
||||
oculus?: boolean;
|
||||
}
|
||||
): Promise<BSVersion>{
|
||||
|
||||
if(!bsPath){ return null; }
|
||||
|
||||
const versionFilePath = path.join(bsPath, 'Beat Saber_Data', 'globalgamemanagers');
|
||||
const folderVersion = await this.getVersionFromGlobalGameManagerFile(versionFilePath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user