Skip to content

Commit

Permalink
[ML] Simplify selectedTerm.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Sep 7, 2021
1 parent 787d9d7 commit b665413
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,8 @@ export function FailedTransactionsCorrelations({
setSelectedSignificantTerm,
] = useState<FailedTransactionsCorrelation | null>(null);

const selectedTerm = useMemo(() => {
if (selectedSignificantTerm) return selectedSignificantTerm;
return Array.isArray(response.failedTransactionsCorrelations) &&
response.failedTransactionsCorrelations.length > 0
? response.failedTransactionsCorrelations[0]
: undefined;
}, [selectedSignificantTerm, response.failedTransactionsCorrelations]);
const selectedTerm =
selectedSignificantTerm ?? response.failedTransactionsCorrelations?.[0];

const history = useHistory();

Expand Down

0 comments on commit b665413

Please sign in to comment.