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, ws,
info, info,
itemInfo, itemInfo,
itemUnequip,
instance, instance,
player, player,
account, account,
@ -37,6 +38,7 @@ const addState = connect(
ws, ws,
info, info,
itemInfo, itemInfo,
itemUnequip,
instance, instance,
player, player,
account, account,
@ -61,15 +63,13 @@ const addState = connect(
class InfoComponent extends preact.Component { class InfoComponent extends preact.Component {
shouldComponentUpdate(newProps, newState) { 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 (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; return false;
} }
@ -82,6 +82,7 @@ class InfoComponent extends preact.Component {
const { const {
// Variables that will change // Variables that will change
info, info,
itemUnequip,
tutorial, tutorial,
vboxHighlight, vboxHighlight,
vboxSelected, vboxSelected,
@ -128,8 +129,9 @@ class InfoComponent extends preact.Component {
if (storeSelect.length > 0) return vbox.free[storeSelect[0][0]][storeSelect[0][1]]; if (storeSelect.length > 0) return vbox.free[storeSelect[0][0]][storeSelect[0][1]];
return false; return false;
}; };
let vboxInfo = false;
const vboxInfo = (stashSelect.length > 0 || storeSelect.length > 0) ? checkVboxInfo() : false; if (itemUnequip.length) [, vboxInfo] = itemUnequip;
else if (stashSelect.length > 0 || storeSelect.length > 0) vboxInfo = checkVboxInfo();
function Info() { function Info() {
if (tutorial) { if (tutorial) {