diff --git a/platform/representation/src/TemplateLinker.js b/platform/representation/src/TemplateLinker.js index 9a5e8a67f2..dc19943ed8 100644 --- a/platform/representation/src/TemplateLinker.js +++ b/platform/representation/src/TemplateLinker.js @@ -131,22 +131,20 @@ define( } function changeTemplate(templateUrl) { - if (templateUrl !== activeTemplateUrl) { - if (templateUrl) { - addElement(); - self.load(templateUrl).then(function (template) { - // Avoid race conditions - if (templateUrl === activeTemplateUrl) { - populateElement(template); - } - }, function () { - badTemplate(templateUrl); - }); - } else { - removeElement(); - } - activeTemplateUrl = templateUrl; + if (templateUrl) { + addElement(); + self.load(templateUrl).then(function (template) { + // Avoid race conditions + if (templateUrl === activeTemplateUrl) { + populateElement(template); + } + }, function () { + badTemplate(templateUrl); + }); + } else { + removeElement(); } + activeTemplateUrl = templateUrl; } if (templateUrl) {