diff --git a/apps/dcellar-web-ui/src/components/layout/GlobalManagements/GlobalObjectUploadManager.tsx b/apps/dcellar-web-ui/src/components/layout/GlobalManagements/GlobalObjectUploadManager.tsx index 41d42fd0..677454bc 100644 --- a/apps/dcellar-web-ui/src/components/layout/GlobalManagements/GlobalObjectUploadManager.tsx +++ b/apps/dcellar-web-ui/src/components/layout/GlobalManagements/GlobalObjectUploadManager.tsx @@ -170,10 +170,10 @@ export const GlobalObjectUploadManager = memo( axios .put(url, task.waitObject.file, { async onUploadProgress(progressEvent) { - const progress = Math.floor( - (progressEvent.loaded / (progressEvent.total as number)) * 100, - ); - await dispatch(progressFetchList(task)); + const progress = progressEvent.total + ? Math.floor((progressEvent.loaded / progressEvent.total) * 100) + : 0; + progress > 30 && (await dispatch(progressFetchList(task))); if (authModal) return; dispatch(updateUploadProgress({ account: loginAccount, id: task.id, progress })); }, diff --git a/apps/dcellar-web-ui/src/store/slices/object.ts b/apps/dcellar-web-ui/src/store/slices/object.ts index 6b2e252c..ec31d8ac 100644 --- a/apps/dcellar-web-ui/src/store/slices/object.ts +++ b/apps/dcellar-web-ui/src/store/slices/object.ts @@ -486,8 +486,9 @@ export const setupListObjects = const _query = new URLSearchParams(params.query?.toString() || ''); _query.append('max-keys', '1000'); _query.append('delimiter', '/'); + const commonPrefix = _completeCommonPrefix - ? _completeCommonPrefix.split('/').slice(1).join('/') + ? _completeCommonPrefix.split('/').slice(1).join('/') + '/' : objectCommonPrefix; if (commonPrefix) _query.append('prefix', commonPrefix); // support any path list objects, bucketName & _path