forked from MapComplete/MapComplete
Use canonical rendering in windpowermap
This commit is contained in:
parent
f5cc180eea
commit
42d0071b26
5 changed files with 17 additions and 5 deletions
|
@ -3,6 +3,7 @@ import UnitConfigJson from "./UnitConfigJson";
|
|||
import Translations from "../../UI/i18n/Translations";
|
||||
import BaseUIElement from "../../UI/BaseUIElement";
|
||||
import Combine from "../../UI/Base/Combine";
|
||||
import {FixedUiElement} from "../../UI/Base/FixedUiElement";
|
||||
|
||||
export class Unit {
|
||||
public readonly appliesToKeys: Set<string>;
|
||||
|
@ -81,7 +82,10 @@ export class Unit {
|
|||
return undefined;
|
||||
}
|
||||
const [stripped, denom] = this.findDenomination(value)
|
||||
const human = denom.human
|
||||
const human = denom?.human
|
||||
if(human === undefined){
|
||||
return new FixedUiElement(stripped ?? value);
|
||||
}
|
||||
|
||||
const elems = denom.prefix ? [human, stripped] : [stripped, human];
|
||||
return new Combine(elems)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue