You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a component that is lazily loaded (and therefore lazily calls registerThemingParticipant). The callback passed in to registerThemingParticipant is never getting called though and it seems like this is because workbenchThemeService.setColorTheme disposes any previous themingParticipantChangeListener and does not add it back for some code paths.
It looks like setColorTheme assumes that applyTheme will add back the listener here, but there are multiple code paths in setColorTheme that neither call setColorTheme nor add back the listener.
if (themeId === this.currentColorTheme.id && !this.currentColorTheme.isLoaded && this.currentColorTheme.hasEqualData(themeData)) {
// the loaded theme is identical to the perisisted theme. Don't need to send an event.
this.currentColorTheme = themeData;
themeData.setCustomColors(this.colorCustomizations);
return TPromise.as(themeData);
}
When this case is hit, the listener is never re-registered, so subsequent calls to registerThemingParticipant will have no effect.
Activity
sandy081 commentedon Jun 1, 2017
Martin Aeschlimann (@aeschli) I do not see this is an extension API.. are there any steps to verify this?
aeschli commentedon Jun 1, 2017
No, its just in code, no need to verify
sandy081 commentedon Jun 1, 2017
Adding verified tag so that it wont be seen in the to verify list
Do not unregister themingParticipantChangeListener.