Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/plugins/visualize/public/application/legacy_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,19 @@ export function initVisualizeApp(app, deps) {
);
}

// This delay is needed to prevent some navigation issues in Firefox/Safari.
// see https://github.com/elastic/kibana/issues/65161
const delay = res => {
return new Promise(resolve => {
setTimeout(() => resolve(res), 0);
});
};

return data.indexPatterns
.ensureDefaultIndexPattern(history)
.then(() => savedVisualizations.get($route.current.params))
.then(getResolvedResults(deps))
.then(delay)
.catch(
Copy link
Contributor

@wylieconlon wylieconlon May 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: I needed to reread some docs on Chained Promises.

Won't this .catch no longer catch errors from the getResolvedResults function, since the delay function can never throw an error? This looks like it could inadvertently cause our error handling behavior to be different

redirectWhenMissing({
history,
Expand Down