mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Manager refactor, part 1 (#4298)
* Move BackupDatabase and AnonymiseDatabase to internal/manager * Rename config.Instance to config.Config * Rename FFMPEG * Rework manager and initialization process * Fix Makefile * Tweak phasher * Fix config races * Fix setup error not clearing
This commit is contained in:
@@ -43,7 +43,7 @@ export const Setup: React.FC = () => {
|
||||
const [storeBlobsInDatabase, setStoreBlobsInDatabase] = useState(false);
|
||||
const [blobsLocation, setBlobsLocation] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [setupError, setSetupError] = useState("");
|
||||
const [setupError, setSetupError] = useState<string>();
|
||||
|
||||
const intl = useIntl();
|
||||
const history = useHistory();
|
||||
@@ -617,7 +617,11 @@ export const Setup: React.FC = () => {
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
if (e instanceof Error) setSetupError(e.message ?? e.toString());
|
||||
if (e instanceof Error && e.message) {
|
||||
setSetupError(e.message);
|
||||
} else {
|
||||
setSetupError(String(e));
|
||||
}
|
||||
} finally {
|
||||
setLoading(false);
|
||||
next();
|
||||
@@ -737,6 +741,11 @@ export const Setup: React.FC = () => {
|
||||
}
|
||||
|
||||
function renderError() {
|
||||
function onBackClick() {
|
||||
setSetupError(undefined);
|
||||
goBack(2);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<section>
|
||||
@@ -758,7 +767,7 @@ export const Setup: React.FC = () => {
|
||||
</section>
|
||||
<section className="mt-5">
|
||||
<div className="d-flex justify-content-center">
|
||||
<Button variant="secondary mx-2 p-5" onClick={() => goBack(2)}>
|
||||
<Button variant="secondary mx-2 p-5" onClick={onBackClick}>
|
||||
<FormattedMessage id="actions.previous_action" />
|
||||
</Button>
|
||||
</div>
|
||||
@@ -851,7 +860,7 @@ export const Setup: React.FC = () => {
|
||||
}
|
||||
|
||||
function renderFinish() {
|
||||
if (setupError) {
|
||||
if (setupError !== undefined) {
|
||||
return renderError();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user