[bugfix-560] don't move old installation path if it doesn't exist

This commit is contained in:
silentrald
2024-09-05 09:37:32 +08:00
parent 7ae097b990
commit bd371b56e1
6 changed files with 22 additions and 12 deletions
@@ -204,7 +204,7 @@ export function SettingsPage() {
notificationService.notifySuccess({ title: "notifications.settings.move-folder.success.titles.transfer-started", desc: "notifications.settings.move-folder.success.descs.transfer-started" });
lastValueFrom(installationLocationService.setInstallationFolder(fileChooserRes.filePaths[0])).then(res => {
lastValueFrom(installationLocationService.setInstallationFolder(fileChooserRes.filePaths[0], true)).then(res => {
progressBarService.complete();
progressBarService.hide(true);
@@ -23,7 +23,13 @@ export class InstallationLocationService {
return lastValueFrom(this.ipcService.sendV2("bs-installer.install-path"));
}
public setInstallationFolder(path: string): Observable<string> {
return this.ipcService.sendV2("bs-installer.set-install-path", path);
/**
* @param move - if true, move the old installation path to the path param
*/
public setInstallationFolder(path: string, move: boolean): Observable<string> {
return this.ipcService.sendV2(
"bs-installer.set-install-path",
{ path, move }
);
}
}
+1 -1
View File
@@ -52,7 +52,7 @@ export class SetupService {
{ closable: false }
);
await lastValueFrom(this.installationLocationService.setInstallationFolder(modalResponse.data.installPath));
await lastValueFrom(this.installationLocationService.setInstallationFolder(modalResponse.data.installPath, false));
// Refresh the versions tab
await this.versionManagerService.askInstalledVersions();