From 22751d992eee250f75d0c967fe0169d0f883ed1c Mon Sep 17 00:00:00 2001 From: devinxl Date: Thu, 9 May 2024 14:37:58 +0800 Subject: [PATCH] feat(dcellar-web-ui): introduce migrate bucket feature --- apps/dcellar-web-ui/src/facade/bucket.ts | 4 ++-- .../src/modules/bucket/components/MigrateBucketOperation.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/dcellar-web-ui/src/facade/bucket.ts b/apps/dcellar-web-ui/src/facade/bucket.ts index 8a79cec4..77c9c955 100644 --- a/apps/dcellar-web-ui/src/facade/bucket.ts +++ b/apps/dcellar-web-ui/src/facade/bucket.ts @@ -66,7 +66,7 @@ export const headBucket = async (bucketName: string) => { const client = await getClient(); const { bucketInfo } = await client.bucket .headBucket(bucketName) - .catch(() => ({}) as QueryHeadBucketResponse); + .catch(() => ({} as QueryHeadBucketResponse)); return bucketInfo || null; }; @@ -262,7 +262,7 @@ export const getBucketQuotaUpdateTime = async (bucketName: string) => { const defaultValue = new Long(getTimestampInSeconds()); const res = await storageClient .QueryQuotaUpdateTime({ bucketName }) - .catch((e) => ({ updateAt: defaultValue }) as QueryQuoteUpdateTimeResponse); + .catch((e) => ({ updateAt: defaultValue } as QueryQuoteUpdateTimeResponse)); return Number(res?.updateAt || defaultValue); }; diff --git a/apps/dcellar-web-ui/src/modules/bucket/components/MigrateBucketOperation.tsx b/apps/dcellar-web-ui/src/modules/bucket/components/MigrateBucketOperation.tsx index 27c34dd6..fff5440e 100644 --- a/apps/dcellar-web-ui/src/modules/bucket/components/MigrateBucketOperation.tsx +++ b/apps/dcellar-web-ui/src/modules/bucket/components/MigrateBucketOperation.tsx @@ -3,11 +3,11 @@ import { InsufficientBalances } from '@/components/Fee/InsufficientBalances'; import { IconFont } from '@/components/IconFont'; import { DCButton } from '@/components/common/DCButton'; import { useOffChainAuth } from '@/context/off-chain-auth/useOffChainAuth'; -import { migrateBucket } from '@/facade/bucket'; +import { TBucket, setBucketEditQuota, setupBucketList } from '@/store/slices/bucket'; +import { migrateBucket, pollingGetBucket } from '@/facade/bucket'; import { E_OFF_CHAIN_AUTH } from '@/facade/error'; import { BUTTON_GOT_IT, UNKNOWN_ERROR, WALLET_CONFIRM } from '@/modules/object/constant'; import { useAppDispatch, useAppSelector } from '@/store'; -import { TBucket, setBucketEditQuota, setupBucketList } from '@/store/slices/bucket'; import { formatQuota } from '@/utils/string'; import { Divider,