Skip to content

Commit

Permalink
Fix timeranges with invalid comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaHegde committed Dec 17, 2024
1 parent 6e127c9 commit 33a0ac9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
exploreName,
} = data);
$: if (errors?.length) {
const _errs = errors;
setTimeout(() => {
eventBus.emit("notification", {
type: "error",
message: errors[0].message,
message: _errs[0].message,
options: {
persisted: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ function fromTimeRangesParams(
preset.compareTimeRange = ctr;
preset.comparisonMode ??=
V1ExploreComparisonMode.EXPLORE_COMPARISON_MODE_TIME;
} else if (ctr == "") {
preset.compareTimeRange = "";
} else {
errors.push(getSingleFieldError("compare time range", ctr));
}
Expand Down
3 changes: 2 additions & 1 deletion web-local/src/routes/(viz)/explore/[name]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
exploreName,
} = data);
$: if (errors?.length) {
const _errs = errors;
setTimeout(() => {
eventBus.emit("notification", {
type: "error",
message: errors[0].message,
message: _errs[0].message,
options: {
persisted: true,
},
Expand Down

0 comments on commit 33a0ac9

Please sign in to comment.