fix boolean 0 check bullshit

This commit is contained in:
ntr
2019-07-20 22:44:36 +10:00
parent c69182b94e
commit 4ab8e99f1d
4 changed files with 9 additions and 10 deletions
+5 -6
View File
@@ -240,7 +240,7 @@ function Vbox(args) {
const reclaimClass = `vbox-btn reclaim ${reclaiming ? 'reclaiming' : ''}`;
function inventoryBtn(v, i) {
if (!v) return <button disabled class='empty' >&nbsp;</button>;
if (!v && v !== 0) return <button disabled class='empty' >&nbsp;</button>;
function onClick(e) {
if (reclaiming) return sendVboxReclaim(i);
@@ -279,25 +279,24 @@ function Vbox(args) {
}
function combinerBtn() {
const dots = combiner.filter(v => v).length;
let text = '';
if (dots < 3) {
if (combiner.length < 3) {
for (let i = 0; i < 3; i++) {
if (dots > i) {
if (combiner.length > i) {
text += '■ ';
} else {
text += '▫ ';
}
}
} else {
text = 'combine'
text = 'combine';
}
return (
<button
class='vbox-btn'
disabled={dots !== 3}
disabled={combiner.length !== 3}
onMouseOver={e => hoverInfo(e, 'refine')}
onClick={() => sendVboxCombine()}>
{text}