From 6ff88413112883d22e5dc70fdeb08c5efc13e4ee Mon Sep 17 00:00:00 2001 From: baku Date: Tue, 28 Feb 2017 17:44:55 +0100 Subject: [PATCH] Icon+Color must be refreshed when tab changes --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 915c442..6946647 100644 --- a/index.js +++ b/index.js @@ -956,12 +956,16 @@ const ContainerService = { const userContextId = ContainerService._getUserContextIdFromTab(tab); return ContainerService.getIdentity({userContextId}).then(identity => { + const hbox = viewFor(tab.window).document.getElementById("userContext-icons"); + if (!identity) { + hbox.setAttribute("data-identity-color", ""); + hbox.hidden = true; return; } - const hbox = viewFor(tab.window).document.getElementById("userContext-icons"); hbox.setAttribute("data-identity-color", identity.color); + hbox.hidden = false; const label = viewFor(tab.window).document.getElementById("userContext-label"); label.setAttribute("value", identity.name);