mirror of
https://github.com/logos-storage/logos-storage-marketplace-ui.git
synced 2026-01-02 13:33:06 +00:00
Update the total collateral when max size is updated
This commit is contained in:
parent
0dade22403
commit
07d12a8a98
@ -91,14 +91,18 @@ export function AvailabilityForm({
|
||||
|
||||
const onMaxSize = () => {
|
||||
const available = AvailabilityUtils.maxValue(space);
|
||||
const totalSize =
|
||||
Math.floor(
|
||||
((available - 1) /
|
||||
AvailabilityUtils.unitValue(availability.totalSizeUnit)) *
|
||||
10
|
||||
) / 10;
|
||||
|
||||
onAvailabilityChange({
|
||||
totalSize:
|
||||
Math.floor(
|
||||
((available - 1) /
|
||||
AvailabilityUtils.unitValue(availability.totalSizeUnit)) *
|
||||
10
|
||||
) / 10,
|
||||
totalSize,
|
||||
totalCollateral: isTotalCollateralDirty
|
||||
? availability.totalCollateral
|
||||
: Math.round(totalSize * GB),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user