Skip to content

Commit

Permalink
fix: fixed undefined data before computing the plans
Browse files Browse the repository at this point in the history
  • Loading branch information
Kvnstrck authored Feb 3, 2025
1 parent 16a682a commit cc4c723
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 5 additions & 0 deletions visual-debugger/src/lib/components/ui/PlanOverview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
// let queries be up-to-date with the store
currentPlanStore.subscribe((data) => {
if (data === undefined) {
alert("No plans found, please compute the queries before trying to switch between their data.")
return
}
itineraries = data.itineraries;
}
)
Expand Down
10 changes: 2 additions & 8 deletions visual-debugger/src/lib/components/ui/QueryBatchOverview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@
plans = data
//if no plan was previously computed, alert the user of this
if (data === new Array<Plan>) {
if (data == new Array<Plan>) {
alert("No plans found, please compute the queries before trying to switch between their data.")
return
}
}
)
// return if the store is still empty (this means the function was called to early)
if (plans === new Array<Plan>) return;
// load plan of the clicked query into svelte store
currentPlanStore.set(plans[queryIndex - 1])
Expand All @@ -57,10 +54,7 @@
}
}
)
// return if the store is still empty (this means the function was called to early)
if (defaultPlans == undefined) return;
// load plan of the clicked query into svelte store
currentDefaultPlanStore.set(defaultPlans[queryIndex - 1])
}
Expand Down

0 comments on commit cc4c723

Please sign in to comment.