fix: skip restore confirmation during onboarding

This commit is contained in:
Thomas Camlong committed 2026-08-16 22:10:12 +02:00
1 parent 0ec5f36050
commit 7e569bff4c
2 files changed
+6 -9

No files matched your search

@@ -2,11 +2,7 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { getStepAfterRestorePreview, waitForServerReadinessAsync } from "./database-restore-flow";
it("requires confirmation after every restore preview", () => {
expect(getStepAfterRestorePreview()).toBe("confirm");
});
import { waitForServerReadinessAsync } from "./database-restore-flow";
describe("waitForServerReadinessAsync", () => {
beforeEach(() => {
@@ -29,8 +29,6 @@ const RESTART_REQUEST_TIMEOUT_MS = 5_000;
export type ServerReadinessResult = "ready" | "timedOut" | "aborted";
export const getStepAfterRestorePreview = (): RestoreStep => "confirm";
interface WaitForServerReadinessOptions {
restartAfterMs: number;
signal: AbortSignal;
@@ -291,8 +289,11 @@ export const DatabaseRestoreFlow = ({ variant = "card", onRestoreComplete }: Dat
<>
<BackupPreviewPanel analysis={analysis} />
<Group justify="flex-end">
<Button rightSection={<IconArrowRight size={16} />} onClick={() => setStep(getStepAfterRestorePreview())}>
{t("continueToRestore")}
<Button
rightSection={<IconArrowRight size={16} />}
onClick={() => (variant === "standalone" ? void handleConfirm() : setStep("confirm"))}
>
{variant === "standalone" ? t("confirm.submit") : t("continueToRestore")}
</Button>
</Group>
</>