Skip to content

Commit

Permalink
Fix issue with angular scope not firing after setting state on vis
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Oct 8, 2019
1 parent 1a44042 commit 0d7c97d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ export const visualization = () => ({
const { visData, visConfig, params } = config;
const visType = config.visType || visConfig.type;
const $injector = await chrome.dangerouslyGetActiveInjector();
const $timeout = $injector.get('$timeout') as any;
const Private = $injector.get('Private') as any;
const Vis = Private(VisProvider);

if (handlers.vis) {
// special case in visualize, we need to render first (without executing the expression), for maps to work
if (visConfig) {
handlers.vis.setCurrentState({ type: visType, params: visConfig });
if (visConfig && ['tile_map', 'region_map'].includes(visConfig.type)) {
$timeout(() => {
handlers.vis.setCurrentState({ type: visType, params: visConfig });
});
}
} else {
handlers.vis = new Vis({
Expand Down

0 comments on commit 0d7c97d

Please sign in to comment.