Skip to content

Commit

Permalink
Fixes: Bias metric chart selector shows a selected, non-existent char…
Browse files Browse the repository at this point in the history
…t when metrics are deleted by direct call to the TrustyAI API (opendatahub-io#1533)
  • Loading branch information
alexcreasy committed Oct 24, 2023
1 parent 3ee7a87 commit b399fb8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/pages/modelServing/screens/metrics/BiasTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ const BiasTab: React.FC = () => {

React.useEffect(() => {
if (loaded && !loadError) {
// It's possible a biasMetricConfig was deleted by the user directly accessing a backend API. We need to verify
// that any saved state in the session storage is not stale and if it is, remove it.
setSelectedBiasConfigs(selectedBiasConfigs.filter((x) => biasMetricConfigs.includes(x)));

if (firstRender.current) {
// If the user has just navigated here AND they haven't previously selected any charts to display,
// don't show them the "No selected" empty state, instead show them the first available chart.
Expand Down

0 comments on commit b399fb8

Please sign in to comment.