Skip to content

Commit 0d7c97d

Browse files
committed
Fix issue with angular scope not firing after setting state on vis
1 parent 1a44042 commit 0d7c97d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/legacy/core_plugins/interpreter/public/renderers/visualization.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ export const visualization = () => ({
3030
const { visData, visConfig, params } = config;
3131
const visType = config.visType || visConfig.type;
3232
const $injector = await chrome.dangerouslyGetActiveInjector();
33+
const $timeout = $injector.get('$timeout') as any;
3334
const Private = $injector.get('Private') as any;
3435
const Vis = Private(VisProvider);
3536

3637
if (handlers.vis) {
3738
// special case in visualize, we need to render first (without executing the expression), for maps to work
38-
if (visConfig) {
39-
handlers.vis.setCurrentState({ type: visType, params: visConfig });
39+
if (visConfig && ['tile_map', 'region_map'].includes(visConfig.type)) {
40+
$timeout(() => {
41+
handlers.vis.setCurrentState({ type: visType, params: visConfig });
42+
});
4043
}
4144
} else {
4245
handlers.vis = new Vis({

0 commit comments

Comments
 (0)