Skip to content

Commit

Permalink
fix(dcellar-web-ui): refresh task folder error
Browse files Browse the repository at this point in the history
  • Loading branch information
devinxl committed Apr 11, 2024
1 parent ab110fc commit 555281e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ export const GlobalObjectUploadManager = memo<GlobalTasksProps>(
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 }));
},
Expand Down
3 changes: 2 additions & 1 deletion apps/dcellar-web-ui/src/store/slices/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 555281e

Please sign in to comment.