ui/update: fix cancel/close

This commit is contained in:
Johannes Kirschbauer
2025-09-03 12:41:26 +02:00
parent 6cb728a4ca
commit 672af1c63d
2 changed files with 5 additions and 3 deletions

View File

@@ -57,7 +57,7 @@ export interface InstallStoreType {
machineName: string;
mainDisk?: string;
// ...TODO Vars
progress: ApiCall<"run_machine_install">;
progress: ApiCall<"run_machine_install" | "run_machine_update">;
promptValues: PromptValues;
prepareStep: "disk" | "generators" | "install";
};

View File

@@ -27,7 +27,7 @@ interface UpdateStepperProps {
const UpdateStepper = (props: UpdateStepperProps) => {
const stepSignal = useStepper<UpdateSteps>();
const [store, _set] = getStepStore<InstallStoreType>(stepSignal);
const [store, set] = getStepStore<InstallStoreType>(stepSignal);
const [alert, setAlert] = createSignal<AlertProps>();
@@ -62,6 +62,8 @@ const UpdateStepper = (props: UpdateStepperProps) => {
},
},
});
// For cancel
set("install", "progress", call);
const result = await call.result;
@@ -294,7 +296,7 @@ export const UpdateModal = (props: UpdateModalProps) => {
// @ts-expect-error some steps might not have
disablePadding={stepper.currentStep()?.isSplash}
>
<UpdateStepper onDone={() => props.onClose} />
<UpdateStepper onDone={() => props.onClose?.()} />
</Modal>
</StepperProvider>
);