fix boolean 0 check bullshit
This commit is contained in:
@@ -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' > </button>;
|
||||
if (!v && v !== 0) return <button disabled class='empty' > </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}
|
||||
|
||||
Reference in New Issue
Block a user