sadpandajoe commented on code in PR #43340:
URL: https://github.com/apache/superset/pull/43340#discussion_r3866917386
##########
superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx:
##########
@@ -190,36 +215,37 @@ export const useDownloadMenuItems = (
download_url: downloadUrl,
message,
} = json as ExportStatusResponse;
- if (status === "ready") {
+ if (status === 'ready') {
if (downloadUrl) {
- window.location.href = downloadUrl;
+ redirect(downloadUrl);
}
- addSuccessToast(t("Your export is ready and downloading."));
+ addSuccessToast(t('Your export is ready and downloading.'));
return;
}
- if (status === "error") {
+ if (status === 'error') {
addDangerToast(
- message || t("Sorry, something went wrong. Try again later."),
+ message || t('Sorry, something went wrong. Try again later.'),
);
return;
}
- if (Date.now() - startedAt > EXPORT_STATUS_POLL_TIMEOUT_MS) {
+ if (Date.now() - startedAt > pollTimeoutMs) {
addDangerToast(
- t("Your export is taking longer than expected. Try again later."),
+ t('Your export is taking longer than expected. Try again later.'),
);
return;
}
+ addExportPendingToast();
Review Comment:
This re-adds the pending info toast on every poll. Because the toast expires
after four seconds while polling continues every three, it is recreated and
announced repeatedly throughout a slow export—up to roughly 120 times during
the embedded window. Could the pending status be shown once (or updated without
a new alert) until the export reaches a terminal state?
--
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]