From 5506dc9913ade0f51e502e8180bf0b3f9a903ded Mon Sep 17 00:00:00 2001 From: Brian Broll Date: Fri, 24 Jun 2016 15:32:04 -0500 Subject: [PATCH] Removing UI before creating new one - prevents race cond. Fixes #359 --- src/common/globals.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/globals.js b/src/common/globals.js index 24f360792..63a7ea102 100644 --- a/src/common/globals.js +++ b/src/common/globals.js @@ -102,6 +102,10 @@ define([ DeepForge.places = {}; // Create a territory + if (placesTerritoryId) { + client.removeUI(placesTerritoryId); + } + territory[CONSTANTS.PROJECT_ROOT_ID] = {children: 1}; placesTerritoryId = client.addUI(null, updateDeepForgePlaces); @@ -126,6 +130,7 @@ define([ // Remove the territory client.removeUI(placesTerritoryId); + placesTerritoryId = null; }; // Add DeepForge action primitives