clear comboItem error handling

This commit is contained in:
Mashy 2019-11-12 12:03:17 +10:00
parent 27c562d41b
commit c1d4dd3620

View File

@ -20,6 +20,11 @@ class InfoComponent extends preact.Component {
return false;
}
componentDidUpdate(prevProps) {
// Catch case where mouse events don't properly clear state and info changed
if (prevProps.info !== this.props.info) this.setState({ comboItem: null });
}
render(args) {
const {
// Variables that will change
@ -36,7 +41,6 @@ class InfoComponent extends preact.Component {
setTutorialNull,
} = args;
const { comboItem } = this.state;
console.log(comboItem);
function Info() {
if (tutorial) {
const tutorialStageInfo = tutorialStage(tutorial, ws, setTutorialNull, instance);
@ -51,7 +55,7 @@ class InfoComponent extends preact.Component {
Names are randomly generated and are purely cosmetic. <br />
You can change change your construct name in the <b>RESHAPE</b> tab outside of games.
</p>
</div>
</div>
);
}
@ -82,7 +86,6 @@ class InfoComponent extends preact.Component {
if (isSkill || isSpec) {
let infoName = fullInfo.item;
while (infoName.includes('Plus')) infoName = infoName.replace('Plus', '+');
console.log(fullInfo);
const itemSource = itemInfo.combos.filter(c => c.item === removeTier(fullInfo.item));