From f7ebc8f0f1cfc18aebde23e65c7102a58abde0b7 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Fri, 29 May 2026 18:29:16 -0700 Subject: [PATCH] Make this consistent with the other popup --- src/popups/ManageGame.tsx | 196 +++++++++++++++++++------------------- 1 file changed, 100 insertions(+), 96 deletions(-) diff --git a/src/popups/ManageGame.tsx b/src/popups/ManageGame.tsx index a573427..9be457c 100644 --- a/src/popups/ManageGame.tsx +++ b/src/popups/ManageGame.tsx @@ -64,105 +64,109 @@ export default function ManageGamePopup () { return ( <>

Viewing {gameInfo?.name}

-
- {gameInfo?.official ? ( -
- -

Official

-
- ) : ( -
- -

{gameInfo?.verified ? 'Verified' : 'Unverified'}

-
- )} - {gameInfo?.developer != null && ( -
- -

Developer: {gameInfo?.developer}

-
- )} -
- -

- {(() => { - if (!serverVersionList) return 'N/A' - - const gameVersions = serverVersionList.versions.filter( - vf => vf.game === managingGame - ) - const installed = gameVersions.filter(v => - Object.keys(versionsList).includes(v.id) - ).length - return gameVersions.length - ? `${installed}/${gameVersions.length}` - : 'N/A' - })()}{' '} - versions installed -

-
- {versionsInstalled?.length != 0 && ( - <> +
+
+ {gameInfo?.official ? (
- -

- Size on disk:{' '} - {prettyBytes(gameSize, { - minimumFractionDigits: 2, - maximumFractionDigits: 2 - })} -

+ +

Official

-
{ - closePopup() - if (!versionsInstalled) return - - const updatedList = { ...versionsList } - - for (const version of versionsInstalled) - delete updatedList[version.id] - - await versions?.set('list', updatedList) - - for (const version of versionsInstalled) { - const managingVersion = version.id - - if ( - await exists( - (customDataLocation ? customDataLocation + '/' : null) + - 'game/' + - managingVersion, - { - baseDir: customDataLocation - ? undefined - : BaseDirectory.AppLocalData - } - ) - ) - await remove( - (customDataLocation ? customDataLocation + '/' : null) + - 'game/' + - managingVersion, - { - baseDir: customDataLocation - ? undefined - : BaseDirectory.AppLocalData, - recursive: true - } - ) - } - }} - title='Click to uninstall this game. This will NOT remove any progress or any save files.' - > - Uninstall + ) : ( +
+ +

{gameInfo?.verified ? 'Verified' : 'Unverified'}

- - )} + )} + {gameInfo?.developer != null && ( +
+ +

Developer: {gameInfo?.developer}

+
+ )} +
+
+
+ +

+ {(() => { + if (!serverVersionList) return 'N/A' + + const gameVersions = serverVersionList.versions.filter( + vf => vf.game === managingGame + ) + const installed = gameVersions.filter(v => + Object.keys(versionsList).includes(v.id) + ).length + return gameVersions.length + ? `${installed}/${gameVersions.length}` + : 'N/A' + })()}{' '} + versions installed +

+
+ {versionsInstalled?.length != 0 && ( + <> +
+ +

+ Size on disk:{' '} + {prettyBytes(gameSize, { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} +

+
+
{ + closePopup() + if (!versionsInstalled) return + + const updatedList = { ...versionsList } + + for (const version of versionsInstalled) + delete updatedList[version.id] + + await versions?.set('list', updatedList) + + for (const version of versionsInstalled) { + const managingVersion = version.id + + if ( + await exists( + (customDataLocation ? customDataLocation + '/' : null) + + 'game/' + + managingVersion, + { + baseDir: customDataLocation + ? undefined + : BaseDirectory.AppLocalData + } + ) + ) + await remove( + (customDataLocation ? customDataLocation + '/' : null) + + 'game/' + + managingVersion, + { + baseDir: customDataLocation + ? undefined + : BaseDirectory.AppLocalData, + recursive: true + } + ) + } + }} + title='Click to uninstall this game. This will NOT remove any progress or any save files.' + > + Uninstall +
+ + )} +
)