always show itemUnequip in info pane

This commit is contained in:
Mashy 2019-11-24 12:36:22 +10:00
parent 4e9edd241c
commit 775d902184

View File

@ -17,6 +17,7 @@ const addState = connect(
ws,
info,
itemInfo,
itemUnequip,
instance,
player,
account,
@ -37,6 +38,7 @@ const addState = connect(
ws,
info,
itemInfo,
itemUnequip,
instance,
player,
account,
@ -61,15 +63,13 @@ const addState = connect(
class InfoComponent extends preact.Component {
shouldComponentUpdate(newProps, newState) {
if (newProps.vboxSelected !== this.props.vboxSelected) return true;
if (newProps.vboxHighlight !== this.props.vboxHighlight) return true;
if (newProps.tutorial !== this.props.tutorial) return true;
// We don't care about info during tutorial
if (newProps.tutorial && this.props.instance.time_control === 'Practice'
&& this.props.instance.rounds.length === 1) return false;
if (newProps.info !== this.props.info) return true;
if (newState.comboItem !== this.state.comboItem) return true;
if (newProps.itemUnequip !== this.props.itemUnequip) return true;
if (newProps.tutorial !== this.props.tutorial) return true;
if (newProps.vboxHighlight !== this.props.vboxHighlight) return true;
if (newProps.vboxSelected !== this.props.vboxSelected) return true;
if (newState.comboItem !== this.state.comboItem) return true;
return false;
}
@ -82,6 +82,7 @@ class InfoComponent extends preact.Component {
const {
// Variables that will change
info,
itemUnequip,
tutorial,
vboxHighlight,
vboxSelected,
@ -128,8 +129,9 @@ class InfoComponent extends preact.Component {
if (storeSelect.length > 0) return vbox.free[storeSelect[0][0]][storeSelect[0][1]];
return false;
};
const vboxInfo = (stashSelect.length > 0 || storeSelect.length > 0) ? checkVboxInfo() : false;
let vboxInfo = false;
if (itemUnequip.length) [, vboxInfo] = itemUnequip;
else if (stashSelect.length > 0 || storeSelect.length > 0) vboxInfo = checkVboxInfo();
function Info() {
if (tutorial) {