@pushwoosh/smart-components-kit 1.0.62 → 1.0.63
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.
|
@@ -12,6 +12,7 @@ export const useExportService = () => {
|
|
|
12
12
|
rpcGateway
|
|
13
13
|
} = useSPAContext();
|
|
14
14
|
const clearExport = useCallback(() => {
|
|
15
|
+
retriesRef.current = 0;
|
|
15
16
|
setError('');
|
|
16
17
|
setIsTaskInProgress(false);
|
|
17
18
|
setTaskResult(undefined);
|
|
@@ -54,9 +55,7 @@ export const useExportService = () => {
|
|
|
54
55
|
const result = await rpcGateway.exportStatistics.Status(params);
|
|
55
56
|
switch (result.status) {
|
|
56
57
|
case 'STATUS_PENDING':
|
|
57
|
-
|
|
58
|
-
setProgress(Math.round(result.progress));
|
|
59
|
-
}
|
|
58
|
+
setProgress(prev => result.progress > prev ? Math.round(result.progress) : prev);
|
|
60
59
|
clearStatusTimeout();
|
|
61
60
|
if (retriesRef.current < MAX_RETRIES) {
|
|
62
61
|
retriesRef.current += 1;
|
|
@@ -89,7 +88,7 @@ export const useExportService = () => {
|
|
|
89
88
|
retriesRef.current = 0;
|
|
90
89
|
return err;
|
|
91
90
|
}
|
|
92
|
-
}, [clearStatusTimeout, getResult,
|
|
91
|
+
}, [clearStatusTimeout, getResult, rpcGateway]);
|
|
93
92
|
const getLastTasks = useCallback(async params => {
|
|
94
93
|
try {
|
|
95
94
|
const {
|
package/package.json
CHANGED