From 1a6ed38f8fa830c08833ce73234f08014aee2cbf Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Tue, 19 Jul 2022 17:49:40 -0700 Subject: [PATCH] only unpatch when game was patched automatically --- src/ui/App.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ui/App.tsx b/src/ui/App.tsx index 7e226d0..6237880 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -63,12 +63,16 @@ class App extends React.Component { // Emitted for metadata replacing-purposes listen('game_closed', async () => { - const unpatched = await unpatchGame() + const wasPatched = await getConfigOption('patch_metadata') - console.log(`unpatched game? ${unpatched}`) + if (wasPatched) { + const unpatched = await unpatchGame() - if (!unpatched) { - alert(`Could not unpatch game! (You should be able to find your metadata backup in ${await dataDir()}\\cultivation\\)`) + console.log(`unpatched game? ${unpatched}`) + + if (!unpatched) { + alert(`Could not unpatch game! (You should be able to find your metadata backup in ${await dataDir()}\\cultivation\\)`) + } } })