Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/bioforest-full-flow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ async function performTransfer(
await continueBtn.click()
await page.waitForTimeout(500)

// 点击确认转账 (TransferPreviewJob)
const confirmBtn = page.locator(`[data-testid="confirm-preview-button"], button:has-text("${UI_TEXT.confirm.source}")`).first()
// 点击确认转账
const confirmBtn = page.locator(`[data-testid="confirm-transfer-button"], button:has-text("${UI_TEXT.confirm.source}")`).first()
await expect(confirmBtn).toBeVisible({ timeout: 5000 })
await confirmBtn.click()
await page.waitForTimeout(500)
Expand Down
2 changes: 1 addition & 1 deletion e2e/bioforest-real-transfer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async function doTransfer(page: Page, toAddress: string, amount: string, needPay
await expect(continueBtn).toBeEnabled({ timeout: 15000 })
await continueBtn.click()

await page.locator('[data-testid="confirm-preview-button"]').click()
await page.locator('[data-testid="confirm-transfer-button"]').click()

// 验证钱包锁
const patternInput = page.locator('[data-testid="wallet-pattern-input"]')
Expand Down
4 changes: 2 additions & 2 deletions e2e/bioforest-transfer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ describeOrSkip('BioForest 转账测试', () => {
await continueBtn.click()
console.log(' ✅ 继续到确认页')

// 7. 确认转账(TransferPreviewJob)
// 7. 确认转账
console.log('7. 确认转账...')
const confirmBtn = page.locator('[data-testid="confirm-preview-button"]')
const confirmBtn = page.locator('[data-testid="confirm-transfer-button"]')
await expect(confirmBtn).toBeVisible({ timeout: 5000 })
await confirmBtn.click()
console.log(' ✅ 点击确认')
Expand Down
10 changes: 5 additions & 5 deletions e2e/send-transaction.mock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,14 @@ test.describe('发送交易 - Job 弹窗流程', () => {
await page.waitForTimeout(500)

// 检查确认弹窗内容
const confirmBtn = page.locator('[data-testid="confirm-preview-button"]')
const cancelBtn = page.locator('[data-testid="cancel-preview-button"]')
const confirmBtn = page.locator('[data-testid="confirm-transfer-button"]')
const cancelBtn = page.locator('[data-testid="cancel-transfer-button"]')

// 至少一个按钮应该可见(确认或取消)
const hasConfirmUI = await confirmBtn.isVisible() || await cancelBtn.isVisible()

if (hasConfirmUI) {
console.log('TransferPreviewJob opened successfully')
console.log('TransferConfirmJob opened successfully')

// 截图
await expect(page).toHaveScreenshot('send-confirm-job.png')
Expand All @@ -365,7 +365,7 @@ test.describe('发送交易 - Job 弹窗流程', () => {
await expect(page.locator('[data-testid="send-continue-button"]')).toBeVisible()
}
} else {
console.log('TransferPreviewJob may not have opened - check mock configuration')
console.log('TransferConfirmJob may not have opened - check mock configuration')
}
} else {
console.log('Continue button not enabled - mock service may not be configured correctly')
Expand All @@ -390,7 +390,7 @@ test.describe('发送交易 - Job 弹窗流程', () => {
await continueBtn.click()
await page.waitForTimeout(500)

const confirmBtn = page.locator('[data-testid="confirm-preview-button"]')
const confirmBtn = page.locator('[data-testid="confirm-transfer-button"]')

if (await confirmBtn.isVisible()) {
await confirmBtn.click()
Expand Down
107 changes: 0 additions & 107 deletions src/components/wallet/wallet-address-portfolio-from-provider.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions src/i18n/locales/en/transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@
"twoStepSecretDescription": "This address has a security password set. Please enter your security password to confirm the transfer.",
"twoStepSecretPlaceholder": "Enter security password",
"twoStepSecretError": "Incorrect security password",
"fee": "Fee",
"previewTitle": "Transaction Preview"
"fee": "Fee"
},
"destroyPage": {
"title": "Destroy",
Expand Down
3 changes: 1 addition & 2 deletions src/i18n/locales/zh-CN/transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@
"twoStepSecretDescription": "该地址已设置安全密码,请输入安全密码确认转账。",
"twoStepSecretPlaceholder": "输入安全密码",
"twoStepSecretError": "安全密码错误",
"fee": "手续费",
"previewTitle": "交易预览"
"fee": "手续费"
},
"destroyPage": {
"title": "销毁",
Expand Down
12 changes: 4 additions & 8 deletions src/pages/send/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useMemo, useRef, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigation, useActivityParams, useFlow } from '@/stackflow';
import { setTransferPreviewCallback, setTransferWalletLockCallback, setScannerResultCallback } from '@/stackflow/activities/sheets';
import { setTransferConfirmCallback, setTransferWalletLockCallback, setScannerResultCallback } from '@/stackflow/activities/sheets';
import type { Contact, ContactAddress } from '@/stores';
import { addressBookStore, addressBookSelectors, preferencesActions } from '@/stores';
import { PageHeader } from '@/components/layout/page-header';
Expand Down Expand Up @@ -237,8 +237,8 @@ function SendPageContent() {

haptics.impact('light');

// Set up callback: TransferPreview -> TransferWalletLock (合并的钱包锁+二次签名)
setTransferPreviewCallback(
// Set up callback: TransferConfirm -> TransferWalletLock (合并的钱包锁+二次签名)
setTransferConfirmCallback(
async () => {
if (isWalletLockSheetOpen.current) return;
isWalletLockSheetOpen.current = true;
Expand Down Expand Up @@ -300,17 +300,13 @@ function SendPageContent() {
}
);

push('TransferPreviewJob', {
push('TransferConfirmJob', {
amount: state.amount?.toFormatted() ?? '0',
symbol,
decimals: String(state.asset?.decimals ?? chainConfig?.decimals ?? 8),
fromAddress: currentChainAddress?.address ?? '',
toAddress: state.toAddress,
feeAmount: state.feeAmount?.toFormatted() ?? '0',
feeSymbol: state.feeSymbol,
feeLoading: state.feeLoading ? 'true' : 'false',
chainId: selectedChain,
chainName: selectedChainName,
});
};

Expand Down
Loading