Skip to content

Commit

Permalink
Handle empty dataset with message properly
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbyul-here committed Apr 24, 2024
1 parent 7e6b387 commit 7594dd9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/scripts/components/exploration/analysis-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export async function requestDatasetTimeseriesData({
status: TimelineDatasetStatus.ERROR,
error: new ExtendedError(
'The selected time and area of interest contains no valid data. Please adjust your selection.',
'ANALYSIS_NO_DATA'
'ANALYSIS_NO_VALID_DATA'
),
data: null
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function DatasetTrackError(props: {
</>
);
}

if (error instanceof ExtendedError && error.code === 'ANALYSIS_NO_DATA') {
return (
<>
Expand All @@ -153,6 +153,16 @@ export function DatasetTrackError(props: {
</>
);
}
if (error instanceof ExtendedError && error.code === 'ANALYSIS_NO_VALID_DATA') {
return (
<>
{patternContent}
<TrackMessage>
<p>{error.message}</p>
</TrackMessage>
</>
);
}

return (
<>
Expand Down

0 comments on commit 7594dd9

Please sign in to comment.