From 4ab8e99f1d52dbdfc02e536012dbe5c993c2165e Mon Sep 17 00:00:00 2001 From: ntr Date: Sat, 20 Jul 2019 22:44:36 +1000 Subject: [PATCH] fix boolean 0 check bullshit --- client/src/components/vbox.component.jsx | 11 +++++------ client/src/events.jsx | 4 ++-- client/src/keyboard.jsx | 2 +- client/src/reducers.jsx | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index 3f8b9fa4..2633d593 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -240,7 +240,7 @@ function Vbox(args) { const reclaimClass = `vbox-btn reclaim ${reclaiming ? 'reclaiming' : ''}`; function inventoryBtn(v, i) { - if (!v) return ; + if (!v && v !== 0) return ; 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 (