From 05e2fb26be069ddaae98c7e4a3792b1f28a76310 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Wed, 15 Oct 2025 16:31:52 +1100 Subject: [PATCH] Fix setup wizard issues (#6138) * Correct paths in confirm step * Maintain paths when going back from confirm step --- ui/v2.5/src/components/Setup/Setup.tsx | 41 +++++++++++++++++++------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/ui/v2.5/src/components/Setup/Setup.tsx b/ui/v2.5/src/components/Setup/Setup.tsx index 00228f9b0..ab5411fe1 100644 --- a/ui/v2.5/src/components/Setup/Setup.tsx +++ b/ui/v2.5/src/components/Setup/Setup.tsx @@ -511,16 +511,28 @@ const BlobsSection: React.FC<{ }; const SetPathsStep: React.FC = ({ goBack, next }) => { - const { configuration } = useSetupContext(); + const { configuration, setupState } = useSetupContext(); const [showStashAlert, setShowStashAlert] = useState(false); - const [stashes, setStashes] = useState([]); - const [databaseFile, setDatabaseFile] = useState(""); - const [generatedLocation, setGeneratedLocation] = useState(""); - const [cacheLocation, setCacheLocation] = useState(""); - const [storeBlobsInDatabase, setStoreBlobsInDatabase] = useState(false); - const [blobsLocation, setBlobsLocation] = useState(""); + const [stashes, setStashes] = useState( + setupState.stashes ?? [] + ); + const [databaseFile, setDatabaseFile] = useState( + setupState.databaseFile ?? "" + ); + const [generatedLocation, setGeneratedLocation] = useState( + setupState.generatedLocation ?? "" + ); + const [cacheLocation, setCacheLocation] = useState( + setupState.cacheLocation ?? "" + ); + const [storeBlobsInDatabase, setStoreBlobsInDatabase] = useState( + setupState.storeBlobsInDatabase ?? false + ); + const [blobsLocation, setBlobsLocation] = useState( + setupState.blobsLocation ?? "" + ); const overrideDatabase = configuration?.general.databasePath; const overrideGenerated = configuration?.general.generatedPath; @@ -640,12 +652,19 @@ const StashExclusions: React.FC<{ stash: GQL.StashConfig }> = ({ stash }) => { }; const ConfirmStep: React.FC = ({ goBack, next }) => { - const { configuration, pathDir, pathJoin, pwd, setupState } = - useSetupContext(); + const { + configuration, + pathDir, + pathJoin, + setupState, + homeDirPath, + workingDir, + } = useSetupContext(); + // if unset, means use homeDirPath const cfgFile = setupState.configLocation - ? setupState.configLocation - : pathJoin(pwd, "config.yml"); + ? pathJoin(workingDir, setupState.configLocation) + : pathJoin(homeDirPath, "config.yml"); const cfgDir = pathDir(cfgFile); const stashes = setupState.stashes ?? []; const {