EnxDev commented on code in PR #43454:
URL: https://github.com/apache/superset/pull/43454#discussion_r3879716012
##########
superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx:
##########
@@ -86,9 +79,25 @@ export const ResultsPaneOnDashboard = ({
};
});
+ const resultsTabFallback = getStaleResultsTabFallback(
+ activeTabKey,
+ items.map(({ key }) => key),
+ );
+
+ useEffect(() => {
Review Comment:
Yes, that’s a valid observation, and I think it’s worth addressing. The two
components contain structurally identical logic.
In `[DataTablesPane.tsx`
```ts
const resultsTabFallback = getStaleResultsTabFallback(
activeTabKey,
queryResultsPanes.map(({ key }) => key),
);
useEffect(() => {
if (resultsTabFallback) {
setActiveTabKey(resultsTabFallback);
}
}, [resultsTabFallback]);
```
`ResultsPaneOnDashboard.tsx` follows the same pattern, using `items` instead
of `queryResultsPanes`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]