From 3b55c98dde84daf82127c66146e365a19d77b829 Mon Sep 17 00:00:00 2001 From: Mashy Date: Mon, 28 Oct 2019 09:20:07 +1000 Subject: [PATCH] stringify not actually needed just compare obj refs --- client/src/components/instance.constructs.jsx | 2 +- client/src/components/vbox.component.jsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/components/instance.constructs.jsx b/client/src/components/instance.constructs.jsx index fb246a57..7c8c8fc5 100644 --- a/client/src/components/instance.constructs.jsx +++ b/client/src/components/instance.constructs.jsx @@ -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; } diff --git a/client/src/components/vbox.component.jsx b/client/src/components/vbox.component.jsx index f13f3c8f..c7923c87 100644 --- a/client/src/components/vbox.component.jsx +++ b/client/src/components/vbox.component.jsx @@ -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; }