[feat-578] open steam common folder for selecting a proton folder

This commit is contained in:
silentrald
2024-10-23 10:49:46 +08:00
parent 3812ea18e4
commit 77987181de
5 changed files with 30 additions and 6 deletions
@@ -25,7 +25,11 @@ export const LinuxSetupModal: ModalComponent<{}, {}> = ({ resolver }) => {
}
const selectProtonPath = async () => {
const response = await lastValueFrom(ipcService.sendV2("choose-folder"));
const response = await lastValueFrom(ipcService.sendV2("choose-folder", {
parent: "home",
defaultPath: ".local/share/Steam/steamapps/common",
showHidden: true,
}));
if (response.canceled || !response.filePaths?.length) {
return;
}
@@ -47,7 +47,9 @@ export const ShareFoldersModal: ModalComponent<void, BSVersion> = ({ options: {d
const addFolder = async () => {
const versionPath = await lastValueFrom(versionManager.getVersionPath(data));
const folder = await lastValueFrom(ipc.sendV2("choose-folder", versionPath));
const folder = await lastValueFrom(ipc.sendV2("choose-folder", {
defaultPath: versionPath
}));
if (!folder || folder.canceled || !folder.filePaths?.length) {
return;
@@ -185,7 +185,11 @@ export function SettingsPage() {
}
try {
const pathResponse = await lastValueFrom(ipcService.sendV2("choose-folder"));
const pathResponse = await lastValueFrom(ipcService.sendV2("choose-folder", {
parent: "home",
defaultPath: ".local/share/Steam/steamapps/common",
showHidden: true,
}));
if (
pathResponse.canceled
|| !pathResponse.filePaths