feat(VersionsMenu): download to custom path (#87)

This commit is contained in:
/home/neo
2026-06-24 19:58:34 +03:00
committed by GitHub
parent e65ea4e06a
commit 5d7d2148cc
8 changed files with 62 additions and 7 deletions
+28
View File
@@ -80,6 +80,7 @@ const VersionsView = memo(function VersionsView() {
cycleBranch,
customizations,
updateCustomization,
saveCustomPath,
} = useGame();
const { isDayTime } = useConfig();
const [focusIndex, setFocusIndex] = useState<number>(0);
@@ -508,6 +509,33 @@ const VersionsView = memo(function VersionsView() {
Update Available!
</button>
)}
{!isInstalled && (
<button
onClick={async (e) => {
e.stopPropagation();
playPressSound();
setOpenMenuId(null);
try {
const folder = await TauriService.pickFolder();
if (folder) {
await saveCustomPath(edition.instanceId, folder);
toggleInstall(edition.instanceId);
}
} catch (err) {
if (err !== "CANCELED") console.error(err);
}
}}
className="w-full text-left px-3 py-2 text-xs text-[#dddddd] flex items-center gap-2 mc-text-shadow"
>
<img
src="/images/Download_Icon.png"
alt=""
className="w-3.5 h-3.5 object-contain"
style={{ imageRendering: "pixelated" }}
/>
Download to custom path
</button>
)}
{Array.isArray(edition.branches) &&
edition.branches.length > 0 && (
<button