From 201ecf82b44766d05fe19bfb8c0eb90777f4fe4f Mon Sep 17 00:00:00 2001
From: Matei Adriel <rafaeladriel11@gmail.com>
Date: Mon, 13 Apr 2020 23:47:06 +0300
Subject: [PATCH] fix: now you cant edit the labels of nested stuff

---
 .../logic-gates/components/GatePropertiesModal.tsx        | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/modules/logic-gates/components/GatePropertiesModal.tsx b/src/modules/logic-gates/components/GatePropertiesModal.tsx
index 5e0d252..c4e269e 100644
--- a/src/modules/logic-gates/components/GatePropertiesModal.tsx
+++ b/src/modules/logic-gates/components/GatePropertiesModal.tsx
@@ -96,16 +96,18 @@ const GateRawProperty = ({
     }
 
     let input = (() => {
+        const root = gate.props[name] === prop
+        const renderer = getRendererSafely()
         const displayExternal = () =>
-            getRendererSafely().simulation.mode === 'ic' &&
-            gate.env === 'global' &&
+            renderer.simulation.mode === 'ic' &&
+            root &&
             !gate.template.properties.data.some(
                 (prop) => (prop as RawProp).needsUpdate
             )
 
         if (
             (raw.name === 'external' && !displayExternal()) ||
-            (raw.name === 'label' && !external)
+            (raw.name === 'label' && (!external || !root))
         ) {
             return emptyInput
         }