fix: restore always uses ~/Downloads path

This commit is contained in:
garethgeorge
2024-07-01 22:22:43 -07:00
parent 682911cb16
commit c2cf82a07f
2 changed files with 16 additions and 15 deletions
+11 -13
View File
@@ -13,12 +13,7 @@ import {
FolderOutlined,
} from "@ant-design/icons";
import { useShowModal } from "./ModalManager";
import {
formatBytes,
formatDate,
formatTime,
normalizeSnapshotId,
} from "../lib/formatting";
import { formatBytes, normalizeSnapshotId } from "../lib/formatting";
import { URIAutocomplete } from "./URIAutocomplete";
import { validateForm } from "../lib/formutil";
import { backrestService } from "../api";
@@ -254,13 +249,15 @@ const RestoreModal = ({
const handleOk = async () => {
try {
const values = await validateForm(form);
await backrestService.restore({
repoId,
planId,
snapshotId,
path,
target: values.target,
});
await backrestService.restore(
new RestoreSnapshotRequest({
repoId,
planId,
snapshotId,
path,
target: values.target,
})
);
} catch (e: any) {
alert("Failed to restore snapshot: " + e.message);
} finally {
@@ -307,6 +304,7 @@ const RestoreModal = ({
form.setFields([
{
name: "target",
value: targetPath,
errors: [],
},
]);
+5 -2
View File
@@ -7,5 +7,8 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
},
"include": [
"src/**/*"
],
}