mirror of
https://github.com/logos-storage/logos-storage-marketplace-ui.git
synced 2026-06-07 09:09:28 +00:00
Reset availability when the data came from an edit action
This commit is contained in:
parent
dea9078379
commit
fba2a20869
@ -100,11 +100,24 @@ export function AvailabilityCreate({ space }: Props) {
|
||||
setAvailability(val);
|
||||
};
|
||||
|
||||
const onOpen = () =>
|
||||
const onOpen = () => {
|
||||
if (availability.id) {
|
||||
WebStorage.set("availability-step", 0);
|
||||
WebStorage.set("availability", defaultAvailabilityData);
|
||||
|
||||
setAvailability(defaultAvailabilityData);
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: "open",
|
||||
});
|
||||
|
||||
dispatch({
|
||||
step: 0,
|
||||
type: "next",
|
||||
});
|
||||
};
|
||||
|
||||
const onClose = () => dispatch({ type: "close" });
|
||||
|
||||
const Body = components[state.step] || (() => <span />);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user