mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 14:09:31 +02:00
Fix unknown unit types having nonsense options
This commit is contained in:
@@ -48,7 +48,11 @@ export default function NumericInputWithUnit(props: {
|
|||||||
if (unitKind != Qty(props.value.unit).kind()) {
|
if (unitKind != Qty(props.value.unit).kind()) {
|
||||||
// Update the options for what units similar to this one are available
|
// Update the options for what units similar to this one are available
|
||||||
const kind = Qty(props.value.unit).kind();
|
const kind = Qty(props.value.unit).kind();
|
||||||
const units = Qty.getUnits(kind);
|
let units: string[] = [];
|
||||||
|
if (kind) {
|
||||||
|
units = Qty.getUnits(kind);
|
||||||
|
}
|
||||||
|
|
||||||
if (!units.includes(props.value.unit)) {
|
if (!units.includes(props.value.unit)) {
|
||||||
units.push(props.value.unit);
|
units.push(props.value.unit);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user