Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/helpers/unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function createValueUnitPair<T = string>(initialValue = 0, units: Unit<T>
}

const unitInBase = v * prevUnit.value;
return unitInBase / newUnit.value;
return Math.round(unitInBase / newUnit.value);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
});
});
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
return {
name: table.name,
tableId: page.params.table,
databaseId: page.params.database
databaseId: page.params.database,
rowSecurity: table.recordSecurity,
enabled: table.enabled,
permissions: table.$permissions
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
const options = units.map((v) => ({ label: v.name, value: v.name }));
$: selectedUnit = $unit;

const maxValue = function formMaxFileSize() {
return (service * 1000 * 1000) / units.find((unit) => unit.name === selectedUnit).value;
};
$: maxValue = (service * 1000 * 1000) / units.find((unit) => unit.name === selectedUnit).value;

function updateMaxSize() {
updateBucket(
Expand Down Expand Up @@ -80,7 +78,7 @@
disabled={$readOnly && !GRACE_PERIOD_OVERRIDE}
placeholder={bucket.maximumFileSize.toString()}
min={0}
max={isCloud ? maxValue() : Infinity}
max={isCloud ? maxValue : Infinity}
bind:value={$value} />
<InputSelect required id="bytes" label="Bytes" {options} bind:value={$unit} />
</svelte:fragment>
Expand Down
Loading