Skip to content

Commit

Permalink
Fix async call in TourGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Jun 4, 2024
1 parent 60d54b8 commit 67dd190
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 65 deletions.
123 changes: 62 additions & 61 deletions config/plugins/webhooks/demo/tour_generator/script.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions config/plugins/webhooks/demo/tour_generator/tour_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ window.TourGenerator = Backbone.View.extend({
$("#execute").attr("tour_id", "execute");
Toastr.info("Tour generation might take some time.");
$.getJSON(
`${Galaxy.root}api/webhooks/tour_generator/data/`, {
`${Galaxy.root}api/webhooks/tour_generator/data/`,
{
tool_id: toolId,
tool_version: toolVersion,
},
Expand All @@ -31,7 +32,7 @@ window.TourGenerator = Backbone.View.extend({
}
);
},
_getData: function(obj, attempts = 20, delay = 1000) {
_getData: function (obj, attempts = 20, delay = 1000) {
let datasets = [];
_.each(obj.data.hids, (hid) => {
Galaxy.currHistoryPanel.collection.each((dataset) => {
Expand All @@ -49,8 +50,8 @@ window.TourGenerator = Backbone.View.extend({
console.error("Some of the test datasets cannot be found in the history.");
}
},
_generateTour: function (data) {
const tour = window.bundleEntries.runTour("auto.generated", data);
_generateTour: async function (data) {
const tour = await window.bundleEntries.runTour("auto.generated", data);
// Force ending the tour when pressing the Execute button
$("#execute").on("mousedown", () => {
if (tour) {
Expand Down

0 comments on commit 67dd190

Please sign in to comment.