From 33e07608375f34efe684fc268d4c23f7f3e4965b Mon Sep 17 00:00:00 2001 From: Leon Date: Fri, 10 Jan 2025 11:01:13 +0800 Subject: [PATCH] chore: Sync main branch with v5.5.2 (#6483) * Update .env.version * fix: fix the issue where the account selector does not work in the market module. (#6414) * style: modify the background color and hover color of TradingView's indicator. (#6415) * fix: several sentry issues (#6426) * fix: sqlite limit (#6425) * chore: add requestId on sentry xhr breadcrumb (#6427) * fix: qr psbt compare (#6428) (cherry picked from commit d89b91885a4ee52bfcb90188f0a7b39d217feaa2) * feat: Add DTC network (#6431) * Feat: sol sign message OK-34533 (#6420) * feat: sol sign message on headware * feat: update hardware sdk version * chore: fix lint * optimize: sol sign message format * chore: update js sdk 1.0.17 (#6432) * fix: fix the crash when copying in iCloud sync on iOS. (#6433) * Update react-native+0.73.7.patch * Update react-native+0.73.7.patch * Optimize/kaspa transfer OK-34592 (#6423) * feat: optimize kaspa transfer * optimize: hardware transafer kas * Revert "Feat: sol sign message OK-34533 (#6420)" This reverts commit 498a5df44df386f2e5769c5365188ccc6e0ce8be. * fix: fix the issue of using a mismatched derviceType when creating an address. * fix: fix deriveType type * chore: update 5.5.2 * fix: fix the issue where pressing Enter would trigger paste in some forms. (#6471) * fix: fix the issue where the screen module in Electron is loaded prematurely with a low probability. (#6473) * Update .env.version * fix: fix the issue where the screen module in Electron is loaded prematurely with a low probability. --------- Co-authored-by: Leon * fix: Correct Lighting withdrawal invoice amount (#6476) * Revert "fix: fix the issue where the screen module in Electron is loaded prematurely with a low probability. (#6473)" This reverts commit f99ade33d3620ba5b7577d72ae3f9d41d425e992. * chore: prohibit the use of the screen module in Electron Sentry. --------- Co-authored-by: huhuanming Co-authored-by: weatherstar Co-authored-by: ByteZhang Co-authored-by: morizon --- apps/desktop/src-electron/sentry.ts | 24 +++++++++++++++++++ .../src/primitives/Button/index.tsx | 5 +++- .../AddressInput/plugins/clipboard.tsx | 12 ++++++++-- .../components/WalletActions/RawActions.tsx | 2 +- .../pages/Send/LnurlWithdrawModal.tsx | 2 +- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src-electron/sentry.ts b/apps/desktop/src-electron/sentry.ts index 6004a1e3020..f08b1ed63fb 100644 --- a/apps/desktop/src-electron/sentry.ts +++ b/apps/desktop/src-electron/sentry.ts @@ -49,6 +49,30 @@ export const initSentry = () => { 'integrity-failure', ], }), + Sentry.electronBreadcrumbsIntegration({ + app: (name) => !name.startsWith('remote-'), + autoUpdater: true, + webContents: (name) => + ['dom-ready', 'context-menu', 'load-url', 'destroyed'].includes(name), + browserWindow: (name) => + [ + 'closed', + 'close', + 'unresponsive', + 'responsive', + 'show', + 'blur', + 'focus', + 'hide', + 'maximize', + 'minimize', + 'restore', + 'enter-full-screen', + 'leave-full-screen', + ].includes(name), + screen: false, + powerMonitor: true, + }), ], }); }; diff --git a/packages/components/src/primitives/Button/index.tsx b/packages/components/src/primitives/Button/index.tsx index efe55d8944d..c86809cb29d 100644 --- a/packages/components/src/primitives/Button/index.tsx +++ b/packages/components/src/primitives/Button/index.tsx @@ -1,3 +1,4 @@ +import type { ButtonHTMLAttributes } from 'react'; import { useMemo } from 'react'; import { @@ -18,6 +19,7 @@ import type { IIconProps, IKeyOfIcons } from '../Icon'; import type { ColorTokens, FontSizeTokens, ThemeableStackProps } from 'tamagui'; export interface IButtonProps extends ThemeableStackProps { + type?: ButtonHTMLAttributes['type']; size?: 'small' | 'medium' | 'large'; variant?: 'secondary' | 'tertiary' | 'primary' | 'destructive'; icon?: IKeyOfIcons; @@ -145,10 +147,11 @@ const useSizeStyles = (size: IButtonProps['size']) => export const ButtonFrame = styled(ThemeableStack, { tag: 'button', role: 'button', + type: 'button', flexDirection: 'row', justifyContent: 'center', alignItems: 'center', -}); +} as IButtonProps); function ButtonIcon({ variant, diff --git a/packages/kit/src/components/AddressInput/plugins/clipboard.tsx b/packages/kit/src/components/AddressInput/plugins/clipboard.tsx index cf61d5adfac..c819c4eac7f 100644 --- a/packages/kit/src/components/AddressInput/plugins/clipboard.tsx +++ b/packages/kit/src/components/AddressInput/plugins/clipboard.tsx @@ -2,7 +2,7 @@ import { type FC, useCallback } from 'react'; import { useIntl } from 'react-intl'; -import { IconButton, useClipboard } from '@onekeyhq/components'; +import { IconButton, Toast, useClipboard } from '@onekeyhq/components'; import { ETranslations } from '@onekeyhq/shared/src/locale'; import platformEnv from '@onekeyhq/shared/src/platformEnv'; import { EInputAddressChangeType } from '@onekeyhq/shared/types/address'; @@ -20,7 +20,15 @@ export const ClipboardPlugin: FC = ({ const text = await getClipboard(); onChange?.(text); onInputTypeChange?.(EInputAddressChangeType.Paste); - }, [getClipboard, onChange, onInputTypeChange]); + + if (text?.length) { + Toast.success({ + title: intl.formatMessage({ + id: ETranslations.feedback_address_pasted_text, + }), + }); + } + }, [getClipboard, intl, onChange, onInputTypeChange]); return platformEnv.isExtensionUiPopup || platformEnv.isExtensionUiSidePanel ? null : ( ; +} & Partial & Omit>; function ActionItem({ icon = 'PlaceholderOutline', diff --git a/packages/kit/src/views/LightningNetwork/pages/Send/LnurlWithdrawModal.tsx b/packages/kit/src/views/LightningNetwork/pages/Send/LnurlWithdrawModal.tsx index 116b238e87f..9511dee0b33 100644 --- a/packages/kit/src/views/LightningNetwork/pages/Send/LnurlWithdrawModal.tsx +++ b/packages/kit/src/views/LightningNetwork/pages/Send/LnurlWithdrawModal.tsx @@ -93,7 +93,7 @@ function LnurlWithdrawModal() { const { serviceLightning } = backgroundApiProxy; const formValue = useFormReturn.getValues(); - const amount = new BigNumber(formValue.amount).times(1000).toNumber(); // convert to millisatoshis + const amount = new BigNumber(formValue.amount).toNumber(); try { const invoice = await serviceLightning.createInvoice({ networkId,