Don't show mass twice and allow to disable showing mass

This commit is contained in:
Felix Linker
2021-02-01 21:56:35 +01:00
parent 187c5dae4a
commit 44dbdb1703
2 changed files with 9 additions and 5 deletions

View File

@@ -124,15 +124,18 @@ export default class Slot extends TranslatedComponent {
</span>
)}
</div>
<div className={'r'}>
{formats.round(mass)}
{units.T}
</div>
{propsToShow.mass ?
<div className={'r'}>
{formats.round(mass)}
{units.T}
</div> : null}
</div>
<div className={'cb'}>
{toPairs(propsToShow).sort().map(([prop, show]) => {
const { unit, value } = m.getFormatted(prop, true);
if (!show || isNaN(value)) {
// Don't show mass again; it's already shown on the top right
// corner of a slot
if (!show || isNaN(value) || prop == 'mass') {
return null;
} else {
return (<div className='l'>

View File

@@ -108,6 +108,7 @@ const SHOW_BY_DEFAULT = {
'scannerrange': true,
'scannertimetoscan': true,
'maxangle': true,
'mass': true,
};
/**