@visns-studio/visns-components 3.3.8 → 3.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -195,9 +195,9 @@ const DataGrid = forwardRef(
|
|
|
195
195
|
}));
|
|
196
196
|
|
|
197
197
|
const handleDownload = async (d) => {
|
|
198
|
-
|
|
199
|
-
toast.success('Starting download please wait...');
|
|
198
|
+
const toastId = toast.loading('Starting download please wait...');
|
|
200
199
|
|
|
200
|
+
try {
|
|
201
201
|
const res = await Download(
|
|
202
202
|
`/ajax/files/download/${d.id}/null`,
|
|
203
203
|
'GET',
|
|
@@ -218,6 +218,9 @@ const DataGrid = forwardRef(
|
|
|
218
218
|
}
|
|
219
219
|
} catch (error) {
|
|
220
220
|
console.info(error);
|
|
221
|
+
} finally {
|
|
222
|
+
// Dismiss the loading toast in the finally block to ensure it's always dismissed
|
|
223
|
+
toast.dismiss(toastId);
|
|
221
224
|
}
|
|
222
225
|
};
|
|
223
226
|
|
package/package.json
CHANGED