stringify not actually needed just compare obj refs

This commit is contained in:
Mashy 2019-10-28 09:20:07 +10:00
parent c534f973a1
commit 3b55c98dde
2 changed files with 3 additions and 3 deletions

View File

@ -249,7 +249,7 @@ class InstanceConstructs extends preact.Component {
if (newProps.tutorial !== this.props.tutorial) return true;
if (newProps.navInstance !== this.props.navInstance) return true;
// JSON or Array objects
if (JSON.stringify(newProps.player) !== JSON.stringify(this.props.player)) return true;
if (newProps.player !== this.props.player) return true;
return false;
}

View File

@ -107,8 +107,8 @@ class Vbox extends preact.Component {
// Don't bother if info changes during tutorial
if (!newProps.tutorial && newProps.info !== this.props.info) return true;
// JSON or Array objects
if (JSON.stringify(newProps.vboxSelected) !== JSON.stringify(this.props.vboxSelected)) return true;
if (JSON.stringify(newProps.player) !== JSON.stringify(this.props.player)) return true;
if (newProps.vboxSelected !== this.props.vboxSelected) return true;
if (newProps.player !== this.props.player) return true;
return false;
}