mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
Fix setup wizard issues (#6138)
* Correct paths in confirm step * Maintain paths when going back from confirm step
This commit is contained in:
parent
7b182ac04b
commit
05e2fb26be
1 changed files with 30 additions and 11 deletions
|
|
@ -511,16 +511,28 @@ const BlobsSection: React.FC<{
|
||||||
};
|
};
|
||||||
|
|
||||||
const SetPathsStep: React.FC<IWizardStep> = ({ goBack, next }) => {
|
const SetPathsStep: React.FC<IWizardStep> = ({ goBack, next }) => {
|
||||||
const { configuration } = useSetupContext();
|
const { configuration, setupState } = useSetupContext();
|
||||||
|
|
||||||
const [showStashAlert, setShowStashAlert] = useState(false);
|
const [showStashAlert, setShowStashAlert] = useState(false);
|
||||||
|
|
||||||
const [stashes, setStashes] = useState<GQL.StashConfig[]>([]);
|
const [stashes, setStashes] = useState<GQL.StashConfig[]>(
|
||||||
const [databaseFile, setDatabaseFile] = useState("");
|
setupState.stashes ?? []
|
||||||
const [generatedLocation, setGeneratedLocation] = useState("");
|
);
|
||||||
const [cacheLocation, setCacheLocation] = useState("");
|
const [databaseFile, setDatabaseFile] = useState(
|
||||||
const [storeBlobsInDatabase, setStoreBlobsInDatabase] = useState(false);
|
setupState.databaseFile ?? ""
|
||||||
const [blobsLocation, setBlobsLocation] = useState("");
|
);
|
||||||
|
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 overrideDatabase = configuration?.general.databasePath;
|
||||||
const overrideGenerated = configuration?.general.generatedPath;
|
const overrideGenerated = configuration?.general.generatedPath;
|
||||||
|
|
@ -640,12 +652,19 @@ const StashExclusions: React.FC<{ stash: GQL.StashConfig }> = ({ stash }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const ConfirmStep: React.FC<IWizardStep> = ({ goBack, next }) => {
|
const ConfirmStep: React.FC<IWizardStep> = ({ goBack, next }) => {
|
||||||
const { configuration, pathDir, pathJoin, pwd, setupState } =
|
const {
|
||||||
useSetupContext();
|
configuration,
|
||||||
|
pathDir,
|
||||||
|
pathJoin,
|
||||||
|
setupState,
|
||||||
|
homeDirPath,
|
||||||
|
workingDir,
|
||||||
|
} = useSetupContext();
|
||||||
|
|
||||||
|
// if unset, means use homeDirPath
|
||||||
const cfgFile = setupState.configLocation
|
const cfgFile = setupState.configLocation
|
||||||
? setupState.configLocation
|
? pathJoin(workingDir, setupState.configLocation)
|
||||||
: pathJoin(pwd, "config.yml");
|
: pathJoin(homeDirPath, "config.yml");
|
||||||
const cfgDir = pathDir(cfgFile);
|
const cfgDir = pathDir(cfgFile);
|
||||||
const stashes = setupState.stashes ?? [];
|
const stashes = setupState.stashes ?? [];
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue