bito-code-review[bot] commented on PR #44031:
URL: https://github.com/apache/superset/pull/44031#issuecomment-5595653868

   <!-- Bito Reply -->
   The current implementation of `addWarningToast` in `downloadAsPivotExcel.ts` 
is indeed just an action creator, which does not trigger the toast display on 
its own. To make this functional, you should use a dispatch-bound version of 
the action. 
   
   Since `exportPivotExcel` is a standard function and not a React component or 
hook, you would typically need to access the Redux store's `dispatch` method 
directly. If you have access to the store instance, you can wrap the call like 
this:
   
   ```typescript
   import { store } from 'src/views/store'; // Adjust path to your store
   // ...
   store.dispatch(addWarningToast(t('Pivot table download failed, please 
refresh and try again.')));
   ```
   
   Alternatively, if you prefer to keep the utility decoupled from the store, 
you could refactor `exportPivotExcel` to accept a `dispatch` function as an 
argument, allowing the caller to provide the necessary dispatch capability.
   
   **superset-frontend/src/utils/downloadAsPivotExcel.ts**
   ```
   store.dispatch(addWarningToast(t('Pivot table download failed, please 
refresh and try again.')));
   ```


-- 
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]

Reply via email to