fix: add worker message trigger
This commit is contained in:
@@ -61,7 +61,6 @@ const useSetChunkRequest = () => {
|
||||
const timer = useRef<any>(null);
|
||||
const loadedSize = useRef(0);
|
||||
const workerRef = useRef<any>(null);
|
||||
const startLoadingRef = useRef(false);
|
||||
|
||||
const reset = () => {
|
||||
loaded.current = 0;
|
||||
@@ -170,7 +169,6 @@ const useSetChunkRequest = () => {
|
||||
const setChunkRequest = (config: RequestConfig) => {
|
||||
requestConfig.current = { ...particalConfig, ...config };
|
||||
retryCount.current = totalCount;
|
||||
startLoadingRef.current = false;
|
||||
clearTimeout(timer.current);
|
||||
axiosChunkRequest(requestConfig.current);
|
||||
return axiosToken;
|
||||
@@ -203,17 +201,11 @@ const useSetChunkRequest = () => {
|
||||
2 ** (totalCount - retryCount.current) * 1000
|
||||
);
|
||||
}
|
||||
if (requestReadyState === 3) {
|
||||
setTimeout(() => {
|
||||
startLoadingRef.current = true;
|
||||
}, 5000);
|
||||
}
|
||||
}, [requestReadyState]);
|
||||
|
||||
return {
|
||||
setChunkRequest,
|
||||
createAxiosToken,
|
||||
startLoadingRef
|
||||
createAxiosToken
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user