diff --git a/packages/kit-bg/src/dbs/local/LocalDbBase.ts b/packages/kit-bg/src/dbs/local/LocalDbBase.ts index 1ba4ce6605f..ea064f84bae 100644 --- a/packages/kit-bg/src/dbs/local/LocalDbBase.ts +++ b/packages/kit-bg/src/dbs/local/LocalDbBase.ts @@ -832,10 +832,17 @@ export abstract class LocalDbBase extends LocalDbBaseContainer { return indexedAccount; } - async getIndexedAccountByAccount({ account }: { account: IDBAccount }) { + async getIndexedAccountByAccount({ + account, + }: { + account: IDBAccount | undefined; + }): Promise { const perf = perfUtils.createPerf( EPerformanceTimerLogNames.localDB__getIndexedAccountByAccount, ); + if (!account) { + return undefined; + } perf.markStart('checkAccountType'); const accountId = account.id; diff --git a/packages/kit-bg/src/services/ServiceAccount/ServiceAccount.ts b/packages/kit-bg/src/services/ServiceAccount/ServiceAccount.ts index c31c4bbec56..20c460999be 100644 --- a/packages/kit-bg/src/services/ServiceAccount/ServiceAccount.ts +++ b/packages/kit-bg/src/services/ServiceAccount/ServiceAccount.ts @@ -293,6 +293,15 @@ class ServiceAccount extends ServiceBase { return localDb.getIndexedAccountSafe({ id }); } + @backgroundMethod() + async getIndexedAccountByAccount({ + account, + }: { + account: IDBAccount | undefined; + }) { + return localDb.getIndexedAccountByAccount({ account }); + } + async buildPrepareHdOrHwIndexes({ indexedAccountId, indexes, diff --git a/packages/kit-bg/src/services/ServiceNotification/ServiceNotification.ts b/packages/kit-bg/src/services/ServiceNotification/ServiceNotification.ts index e295ffffc69..8d85bcf751d 100644 --- a/packages/kit-bg/src/services/ServiceNotification/ServiceNotification.ts +++ b/packages/kit-bg/src/services/ServiceNotification/ServiceNotification.ts @@ -242,6 +242,8 @@ export default class ServiceNotification extends ServiceBase { message: params?.remotePushMessageInfo, isFromNotificationClick: true, notificationId: notificationId || '', + notificationAccountId: + params?.remotePushMessageInfo?.extras?.params?.accountId, }); void this.removeNotification({ diff --git a/packages/kit/src/components/AddressInfo/index.tsx b/packages/kit/src/components/AddressInfo/index.tsx index f8f4aea67e2..137e862ec3a 100644 --- a/packages/kit/src/components/AddressInfo/index.tsx +++ b/packages/kit/src/components/AddressInfo/index.tsx @@ -1,16 +1,105 @@ -import { Badge, XStack } from '@onekeyhq/components'; +import { Badge, Dialog, Stack, XStack } from '@onekeyhq/components'; +import { ERootRoutes, ETabRoutes } from '@onekeyhq/shared/src/routes'; +import { EAccountSelectorSceneName } from '@onekeyhq/shared/types'; +import { ETranslations } from '@onekeyhq/shared/src/locale/enum/translations'; +import { useIntl } from 'react-intl'; import backgroundApiProxy from '../../background/instance/backgroundApiProxy'; +import useAppNavigation from '../../hooks/useAppNavigation'; import { usePromiseResult } from '../../hooks/usePromiseResult'; +import { useAccountSelectorActions } from '../../states/jotai/contexts/accountSelector'; +import { AccountSelectorProviderMirror } from '../AccountSelector'; type IProps = { accountId?: string; networkId: string; address: string; + allowClickAccountNameSwitch?: boolean; }; +type ISwitchHomeAccountButtonProps = { + accountId: string | undefined; + children: React.ReactNode; + walletAccountName: string; +}; +function SwitchHomeAccountButton({ + accountId, + walletAccountName, + children, +}: ISwitchHomeAccountButtonProps) { + const actions = useAccountSelectorActions(); + const navigation = useAppNavigation(); + const intl = useIntl(); + return ( + { + Dialog.show({ + icon: 'SwitchHorOutline', + title: intl.formatMessage( + { + id: ETranslations.history_switch_account_dialog_title, + }, + { + account: walletAccountName, + }, + ), // `Switch primary account to ${walletAccountName}`, + onConfirm: async () => { + const account = + await backgroundApiProxy.serviceAccount.getDBAccountSafe({ + accountId: accountId || '', + }); + + const indexedAccount = + await backgroundApiProxy.serviceAccount.getIndexedAccountByAccount( + { + account, + }, + ); + + if (!indexedAccount && !account) { + return; + } + + // TODO pop to top + navigation.popStack(); + navigation.popStack(); + navigation.popStack(); + navigation.navigate(ERootRoutes.Main, { + screen: ETabRoutes.Home, + params: {}, + }); + + setTimeout(async () => { + await actions.current.confirmAccountSelect({ + num: 0, + othersWalletAccount: indexedAccount ? undefined : account, + indexedAccount, + }); + }, 300); + }, + }); + }} + > + {children} + + ); +} + +function SwitchHomeAccountContainer(props: ISwitchHomeAccountButtonProps) { + return ( + + + + ); +} + function AddressInfo(props: IProps) { - const { accountId, networkId, address } = props; + const { accountId, networkId, address, allowClickAccountNameSwitch } = props; const addressQueryResult = usePromiseResult( () => backgroundApiProxy.serviceAccountProfile.queryAddress({ @@ -31,15 +120,25 @@ function AddressInfo(props: IProps) { if ( !addressQueryResult.walletAccountName && !addressQueryResult.addressBookName - ) + ) { return null; + } + + const AccountNameContainer = allowClickAccountNameSwitch + ? SwitchHomeAccountContainer + : Stack; return ( {addressQueryResult.walletAccountName ? ( - - {addressQueryResult.walletAccountName} - + + + {addressQueryResult.walletAccountName} + + ) : null} {addressQueryResult.addressBookName ? ( diff --git a/packages/kit/src/views/AssetDetails/pages/HistoryDetails/HistoryDetails.tsx b/packages/kit/src/views/AssetDetails/pages/HistoryDetails/HistoryDetails.tsx index 0a02e43aae8..54771e10d4d 100644 --- a/packages/kit/src/views/AssetDetails/pages/HistoryDetails/HistoryDetails.tsx +++ b/packages/kit/src/views/AssetDetails/pages/HistoryDetails/HistoryDetails.tsx @@ -251,6 +251,53 @@ export function AssetItem({ ); } +function NotificationAccountInfo({ + notificationAccountId, + networkId, + allowClickAccountNameSwitch, +}: { + notificationAccountId: string; + networkId: string; + allowClickAccountNameSwitch: boolean | undefined; +}) { + const { account: notificationAccount } = useAccountData({ + networkId, + accountId: notificationAccountId, + }); + const notificationAccountAddress = useMemo( + () => + notificationAccount?.addressDetail?.normalizedAddress || + notificationAccount?.address, + [notificationAccount], + ); + const intl = useIntl(); + + return ( + <> + + + + ) : null + } + /> + + + ); +} + function HistoryDetails() { const intl = useIntl(); const route = @@ -266,6 +313,8 @@ function HistoryDetails() { networkId, transactionHash, notificationId, + notificationAccountId, + allowClickAccountNameSwitch, historyTx: historyTxParam, isAllNetworks, checkIsFocused = true, @@ -742,6 +791,7 @@ function HistoryDetails() { address={to} networkId={networkId} accountId={accountId} + allowClickAccountNameSwitch={allowClickAccountNameSwitch} /> } /> @@ -757,6 +807,7 @@ function HistoryDetails() { address={from} networkId={networkId} accountId={accountId} + allowClickAccountNameSwitch={allowClickAccountNameSwitch} /> } /> @@ -771,6 +822,7 @@ function HistoryDetails() { address={swapReceivedAddress ?? ''} networkId={swapReceivedNetworkId ?? ''} accountId={accountId} + allowClickAccountNameSwitch={allowClickAccountNameSwitch} /> } /> @@ -792,6 +844,7 @@ function HistoryDetails() { address={txAddresses.from} networkId={networkId} accountId={accountId} + allowClickAccountNameSwitch={allowClickAccountNameSwitch} /> } /> @@ -804,6 +857,7 @@ function HistoryDetails() { address={txAddresses.to} networkId={networkId} accountId={accountId} + allowClickAccountNameSwitch={allowClickAccountNameSwitch} /> } /> @@ -831,6 +885,7 @@ function HistoryDetails() { intl, networkId, accountId, + allowClickAccountNameSwitch, ]); const renderTxApproveFor = useCallback(() => { @@ -932,7 +987,7 @@ function HistoryDetails() { return ( <> {/* Part 1: What change */} - + {transfersToRender?.map((block) => renderAssetsChange({ transfers: block.transfers, @@ -943,7 +998,7 @@ function HistoryDetails() { {/* Part 2: Details */} - + {/* Primary */} + + {/* Notification account */} + {notificationAccountId ? ( + + ) : null} + {/* Secondary */} @@ -1054,6 +1119,9 @@ function HistoryDetails() { txInfo?.blockHeight, txInfo?.nonce, txInfo?.confirmations, + notificationAccountId, + networkId, + allowClickAccountNameSwitch, renderTxMetaInfo, txid, vaultSettings?.hideBlockExplorer, diff --git a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Icon.tsx b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Icon.tsx index 93515853a1a..056907feb80 100644 --- a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Icon.tsx +++ b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Icon.tsx @@ -50,7 +50,7 @@ const IconGallery = () => ( numColumns={4} data={iconData} renderItem={({ item }) => ( - + {item} diff --git a/packages/kit/src/views/Notifications/pages/NotificationList.tsx b/packages/kit/src/views/Notifications/pages/NotificationList.tsx index f170280d566..a38a5a27f83 100644 --- a/packages/kit/src/views/Notifications/pages/NotificationList.tsx +++ b/packages/kit/src/views/Notifications/pages/NotificationList.tsx @@ -304,6 +304,8 @@ function NotificationList() { void notificationsUtils.navigateToNotificationDetail({ navigation, message: item.body, + notificationAccountId: + item?.body?.extras?.params?.accountId, notificationId: item?.msgId || item?.body?.extras?.params?.msgId || diff --git a/packages/shared/src/locale/enum/translations.ts b/packages/shared/src/locale/enum/translations.ts index 2f12d059b04..b458fa0c5ff 100644 --- a/packages/shared/src/locale/enum/translations.ts +++ b/packages/shared/src/locale/enum/translations.ts @@ -1202,6 +1202,7 @@ hardware_wallet_connection_is_only_available_on_the_official_app = 'hardware.wallet_connection_is_only_available_on_the_official_app', hardware_wallet_connection_is_only_available_on_the_third_party_apps = 'hardware.wallet_connection_is_only_available_on_the_third_party_apps', hidden_assets = 'hidden_assets', + history_notification_receiver_label = 'history.notification_receiver_label', history_switch_account_dialog_title = 'history.switch_account_dialog_title', hw_banner_description = 'hw_banner_description', interact_with_contract = 'interact_with_contract', diff --git a/packages/shared/src/locale/json/bn.json b/packages/shared/src/locale/json/bn.json index e34e8bd5d7d..4941290e8f9 100644 --- a/packages/shared/src/locale/json/bn.json +++ b/packages/shared/src/locale/json/bn.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "হার্ডওয়্যার ওয়ালেট সংযোগ কেবল অফিসিয়াল অ্যাপে পাওয়া যায়", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "হার্ডওয়্যার ওয়ালেট সংযোগ কেবল তৃতীয় পক্ষের অ্যাপসে উপলব্ধ", "hidden_assets": "গোপন সম্পত্তি", + "history.notification_receiver_label": "বিজ্ঞপ্তি প্রাপ্ত হয়েছে", "history.switch_account_dialog_title": "প্রাথমিক অ্যাকাউন্ট {account} এ পরিবর্তন করবেন?", "hw_banner_description": "আপনার ক্রিপ্টো সংরক্ষণ করুন সবচেয়ে শক্তিশালী হার্ডওয়্যার ওয়ালেটের সাহায্যে", "interact_with_contract": "(এর সাথে) যোগাযোগ করুন (প্রতি)", diff --git a/packages/shared/src/locale/json/de.json b/packages/shared/src/locale/json/de.json index 95c4940f271..be234cb79f8 100644 --- a/packages/shared/src/locale/json/de.json +++ b/packages/shared/src/locale/json/de.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "Die Verbindung zur Hardware-Wallet ist nur über die offizielle App möglich", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "Die Verbindung mit der Hardware-Wallet ist nur über Drittanbieter-Apps verfügbar", "hidden_assets": "Versteckte Vermögenswerte", + "history.notification_receiver_label": "Benachrichtigung erhalten von", "history.switch_account_dialog_title": "Primärkonto auf {account} umstellen?", "hw_banner_description": "Sichern Sie Ihre Krypto mit der leistungsstärksten Hardware-Wallet", "interact_with_contract": "Interagieren mit (An)", diff --git a/packages/shared/src/locale/json/en.json b/packages/shared/src/locale/json/en.json index 4a9bf4dfe41..fcbc0ccaf4f 100644 --- a/packages/shared/src/locale/json/en.json +++ b/packages/shared/src/locale/json/en.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "Hardware wallet connection is only available on the official app", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "Hardware wallet connection is only available on third-party apps", "hidden_assets": "Hidden assets", + "history.notification_receiver_label": "Notification received by", "history.switch_account_dialog_title": "Switch primary account to {account}?", "hw_banner_description": "Secure your crypto with the most powerful hardware wallet", "interact_with_contract": "Interact with (To)", diff --git a/packages/shared/src/locale/json/en_US.json b/packages/shared/src/locale/json/en_US.json index 903bd7c00d9..fce7572a1c8 100644 --- a/packages/shared/src/locale/json/en_US.json +++ b/packages/shared/src/locale/json/en_US.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "Hardware wallet connection is only available on the official app", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "Hardware wallet connection is only available on third-party apps", "hidden_assets": "Hidden assets", + "history.notification_receiver_label": "Notification received by", "history.switch_account_dialog_title": "Switch primary account to {account}?", "hw_banner_description": "Secure your crypto with the most powerful hardware wallet", "interact_with_contract": "Interact with (To)", diff --git a/packages/shared/src/locale/json/es.json b/packages/shared/src/locale/json/es.json index 4dbc63e790c..90f769a67fa 100644 --- a/packages/shared/src/locale/json/es.json +++ b/packages/shared/src/locale/json/es.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "La conexión con la cartera de hardware solo está disponible en la aplicación oficial", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "La conexión a la cartera de hardware solo está disponible en aplicaciones de terceros", "hidden_assets": "Activos ocultos", + "history.notification_receiver_label": "Notificación recibida por", "history.switch_account_dialog_title": "¿Cambiar la cuenta principal a {account}?", "hw_banner_description": "Asegura tu cripto con la cartera de hardware más potente", "interact_with_contract": "Interactuar con (Para)", diff --git a/packages/shared/src/locale/json/fr_FR.json b/packages/shared/src/locale/json/fr_FR.json index 4ecad4fd8c0..d06ef8bd2ec 100644 --- a/packages/shared/src/locale/json/fr_FR.json +++ b/packages/shared/src/locale/json/fr_FR.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "La connexion au portefeuille matériel n'est disponible que sur l'application officielle", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "La connexion à un portefeuille matériel n'est disponible que sur les applications tierces", "hidden_assets": "Actifs cachés", + "history.notification_receiver_label": "Notification reçue par", "history.switch_account_dialog_title": "Passer au compte principal {account} ?", "hw_banner_description": "Sécurisez votre crypto avec le portefeuille matériel le plus puissant", "interact_with_contract": "Interagir avec (À)", diff --git a/packages/shared/src/locale/json/hi_IN.json b/packages/shared/src/locale/json/hi_IN.json index 69e6b229965..16a7c3bf6d2 100644 --- a/packages/shared/src/locale/json/hi_IN.json +++ b/packages/shared/src/locale/json/hi_IN.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "हार्डवेयर वॉलेट कनेक्शन केवल आधिकारिक ऐप पर ही उपलब्ध है", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "हार्डवेयर वॉलेट कनेक्शन केवल तीसरे पक्ष के ऐप्स पर उपलब्ध है", "hidden_assets": "छिपे हुए संपत्ति", + "history.notification_receiver_label": "द्वारा अधिसूचना प्राप्त हुई", "history.switch_account_dialog_title": "प्राथमिक खाता {account} में बदलें?", "hw_banner_description": "अपने क्रिप्टो को सबसे शक्तिशाली हार्डवेयर वॉलेट के साथ सुरक्षित करें", "interact_with_contract": "(से) संवाद करें", diff --git a/packages/shared/src/locale/json/id.json b/packages/shared/src/locale/json/id.json index 1d12fb0e940..e2c476ec2ac 100644 --- a/packages/shared/src/locale/json/id.json +++ b/packages/shared/src/locale/json/id.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "Koneksi dompet perangkat keras hanya tersedia di aplikasi resmi", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "Koneksi dompet perangkat keras hanya tersedia di aplikasi pihak ketiga", "hidden_assets": "Aset tersembunyi", + "history.notification_receiver_label": "Pemberitahuan diterima oleh", "history.switch_account_dialog_title": "Ubah akun utama ke {account}?", "hw_banner_description": "Amanakan kripto Anda dengan dompet perangkat keras yang paling kuat", "interact_with_contract": "Berinteraksi dengan (Kepada)", diff --git a/packages/shared/src/locale/json/it_IT.json b/packages/shared/src/locale/json/it_IT.json index 80505c72cba..fd1be66057d 100644 --- a/packages/shared/src/locale/json/it_IT.json +++ b/packages/shared/src/locale/json/it_IT.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "La connessione al portafoglio hardware è disponibile solo sull'app ufficiale", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "La connessione al portafoglio hardware è disponibile solo su app di terze parti", "hidden_assets": "Beni nascosti", + "history.notification_receiver_label": "Notifica ricevuta da", "history.switch_account_dialog_title": "Passare all'account principale {account}?", "hw_banner_description": "Proteggi le tue criptovalute con il portafoglio hardware più potente", "interact_with_contract": "Interagisci con (A)", diff --git a/packages/shared/src/locale/json/ja_JP.json b/packages/shared/src/locale/json/ja_JP.json index b05831c7ec7..b186b16b5f4 100644 --- a/packages/shared/src/locale/json/ja_JP.json +++ b/packages/shared/src/locale/json/ja_JP.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "ハードウェアウォレットの接続は公式アプリでのみ利用可能です", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "ハードウェアウォレットの接続は、サードパーティのアプリでのみ利用可能です", "hidden_assets": "隠された資産", + "history.notification_receiver_label": "通知を受け取った人", "history.switch_account_dialog_title": "主なアカウントを{account}に切り替えますか?", "hw_banner_description": "最強力なハードウェアウォレットであなたの暗号を保護します", "interact_with_contract": "(に)交流する", diff --git a/packages/shared/src/locale/json/ko_KR.json b/packages/shared/src/locale/json/ko_KR.json index 460079b8802..3d3b98248af 100644 --- a/packages/shared/src/locale/json/ko_KR.json +++ b/packages/shared/src/locale/json/ko_KR.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "하드웨어 지갑 연결은 공식 앱에서만 가능합니다", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "하드웨어 지갑 연결은 서드파티 앱에서만 가능합니다", "hidden_assets": "숨겨진 자산", + "history.notification_receiver_label": "알림 수신자", "history.switch_account_dialog_title": "주 계정을 {account}(으)로 전환하시겠습니까?", "hw_banner_description": "가장 강력한 하드웨어 지갑으로 귀하의 암호화폐를 보호하세요", "interact_with_contract": "(~와) 상호 작용하기", diff --git a/packages/shared/src/locale/json/pt.json b/packages/shared/src/locale/json/pt.json index cdbab1db0ef..efc89763300 100644 --- a/packages/shared/src/locale/json/pt.json +++ b/packages/shared/src/locale/json/pt.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "A conexão com a carteira de hardware está disponível apenas no aplicativo oficial", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "A conexão com a carteira de hardware está disponível apenas em aplicativos de terceiros", "hidden_assets": "Ativos ocultos", + "history.notification_receiver_label": "Notificação recebida por", "history.switch_account_dialog_title": "Alterar a conta principal para {account}?", "hw_banner_description": "Proteja sua criptomoeda com a carteira de hardware mais poderosa", "interact_with_contract": "Interagir com (Para)", diff --git a/packages/shared/src/locale/json/pt_BR.json b/packages/shared/src/locale/json/pt_BR.json index 6d799778b59..59415751adb 100644 --- a/packages/shared/src/locale/json/pt_BR.json +++ b/packages/shared/src/locale/json/pt_BR.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "A conexão com a carteira de hardware está disponível apenas no aplicativo oficial", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "A conexão com a carteira de hardware está disponível apenas em aplicativos de terceiros", "hidden_assets": "Ativos ocultos", + "history.notification_receiver_label": "Notificação recebida por", "history.switch_account_dialog_title": "Alterar a conta principal para {account}?", "hw_banner_description": "Proteja seu cripto com a carteira de hardware mais poderosa", "interact_with_contract": "Interagir com (Para)", diff --git a/packages/shared/src/locale/json/ru.json b/packages/shared/src/locale/json/ru.json index b23967de178..ad19764351a 100644 --- a/packages/shared/src/locale/json/ru.json +++ b/packages/shared/src/locale/json/ru.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "Подключение аппаратного кошелька доступно только в официальном приложении", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "Подключение аппаратного кошелька доступно только в сторонних приложениях", "hidden_assets": "Скрытые активы", + "history.notification_receiver_label": "Уведомление получено", "history.switch_account_dialog_title": "Переключить основной аккаунт на {account}?", "hw_banner_description": "Защитите свою криптовалюту с помощью самого мощного аппаратного кошелька", "interact_with_contract": "Взаимодействовать с (К)", diff --git a/packages/shared/src/locale/json/th_TH.json b/packages/shared/src/locale/json/th_TH.json index d6ca2cd04db..318102014a9 100644 --- a/packages/shared/src/locale/json/th_TH.json +++ b/packages/shared/src/locale/json/th_TH.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "การเชื่อมต่อกระเป๋าเงินฮาร์ดแวร์สามารถทำได้เฉพาะบนแอปพลิเคชันอย่างเป็นทางการเท่านั้น", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "การเชื่อมต่อกระเป๋าเงินฮาร์ดแวร์สามารถทำได้เฉพาะบนแอปพลิเคชันของบุคคลที่สามเท่านั้น", "hidden_assets": "สินทรัพย์ที่ซ่อนอยู่", + "history.notification_receiver_label": "การแจ้งเตือนที่ได้รับโดย", "history.switch_account_dialog_title": "เปลี่ยนบัญชีหลักเป็น {account}?", "hw_banner_description": "รักษาความปลอดภัยสำหรับคริปโตของคุณด้วยกระเป๋าเงินฮาร์ดแวร์ที่ทรงพลังที่สุด", "interact_with_contract": "ติดต่อกับ (ถึง)", diff --git a/packages/shared/src/locale/json/uk_UA.json b/packages/shared/src/locale/json/uk_UA.json index a45e8e38c02..cb977272fa4 100644 --- a/packages/shared/src/locale/json/uk_UA.json +++ b/packages/shared/src/locale/json/uk_UA.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "Підключення апаратного гаманця доступне лише в офіційному додатку", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "Підключення апаратного гаманця доступне лише в додатках від третіх сторін", "hidden_assets": "Приховані активи", + "history.notification_receiver_label": "Сповіщення отримано від", "history.switch_account_dialog_title": "Переключити основний рахунок на {account}?", "hw_banner_description": "Захистіть свою криптовалюту за допомогою найпотужнішого апаратного гаманця", "interact_with_contract": "Взаємодіяти з (До)", diff --git a/packages/shared/src/locale/json/vi.json b/packages/shared/src/locale/json/vi.json index 2b0df5dbc14..35a83962607 100644 --- a/packages/shared/src/locale/json/vi.json +++ b/packages/shared/src/locale/json/vi.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "Kết nối ví cứng chỉ có sẵn trên ứng dụng chính thức", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "Kết nối ví cứng chỉ có sẵn trên các ứng dụng của bên thứ ba", "hidden_assets": "Tài sản ẩn", + "history.notification_receiver_label": "Thông báo nhận được bởi", "history.switch_account_dialog_title": "Chuyển tài khoản chính sang {account}?", "hw_banner_description": "Bảo mật tiền điện tử của bạn với ví cứng mạnh mẽ nhất", "interact_with_contract": "Tương tác với (Đến)", diff --git a/packages/shared/src/locale/json/zh_CN.json b/packages/shared/src/locale/json/zh_CN.json index 6501a82f6d6..4d025180c2d 100644 --- a/packages/shared/src/locale/json/zh_CN.json +++ b/packages/shared/src/locale/json/zh_CN.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "硬件钱包连接只在官方应用程序上可用", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "硬件钱包连接只在第三方应用程序上可用", "hidden_assets": "隐藏资产", + "history.notification_receiver_label": "通知接收者", "history.switch_account_dialog_title": "将首要账户切换为{account}?", "hw_banner_description": "使用迄今为止最强大的硬件钱包保护您的加密资产", "interact_with_contract": "交互地址 (至)", diff --git a/packages/shared/src/locale/json/zh_HK.json b/packages/shared/src/locale/json/zh_HK.json index a51941a9b37..e8eb7480674 100644 --- a/packages/shared/src/locale/json/zh_HK.json +++ b/packages/shared/src/locale/json/zh_HK.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "硬體錢包連接僅在官方應用程式上可用", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "硬體錢包連接僅適用於第三方應用程式", "hidden_assets": "隱藏資產", + "history.notification_receiver_label": "通知接收者", "history.switch_account_dialog_title": "將首要帳戶切換至{account}?", "hw_banner_description": "使用迄今為止最強大的硬體錢包保護您的加密資產", "interact_with_contract": "互動地址 (至)", diff --git a/packages/shared/src/locale/json/zh_TW.json b/packages/shared/src/locale/json/zh_TW.json index cfc76af33e9..905dbe331c3 100644 --- a/packages/shared/src/locale/json/zh_TW.json +++ b/packages/shared/src/locale/json/zh_TW.json @@ -1197,6 +1197,7 @@ "hardware.wallet_connection_is_only_available_on_the_official_app": "硬體錢包連接只能在官方應用程式上使用", "hardware.wallet_connection_is_only_available_on_the_third_party_apps": "硬體錢包連接只在第三方應用程式上可用", "hidden_assets": "隱藏資產", + "history.notification_receiver_label": "通知接收者", "history.switch_account_dialog_title": "將首要帳戶切換至{account}?", "hw_banner_description": "使用迄今為止最強大的硬體錢包保護您的加密資產", "interact_with_contract": "互動地址 (至)", diff --git a/packages/shared/src/routes/assetDetails.ts b/packages/shared/src/routes/assetDetails.ts index 52c6989e707..64f7187e6a2 100644 --- a/packages/shared/src/routes/assetDetails.ts +++ b/packages/shared/src/routes/assetDetails.ts @@ -39,9 +39,11 @@ export type IModalAssetDetailsParamList = { transactionHash?: string; accountAddress?: string; notificationId?: string; + notificationAccountId?: string; historyTx: IAccountHistoryTx | undefined; isAllNetworks?: boolean; checkIsFocused?: boolean; + allowClickAccountNameSwitch?: boolean; }; [EModalAssetDetailRoutes.UTXODetails]: { accountId: string; diff --git a/packages/shared/src/utils/notificationsUtils.ts b/packages/shared/src/utils/notificationsUtils.ts index 74931f373da..0eee8388ded 100644 --- a/packages/shared/src/utils/notificationsUtils.ts +++ b/packages/shared/src/utils/notificationsUtils.ts @@ -34,11 +34,13 @@ function convertWebPermissionToEnum( async function navigateToNotificationDetail({ notificationId, + notificationAccountId, message, isFromNotificationClick, navigation, }: { notificationId: string; + notificationAccountId?: string; message: INotificationPushMessageInfo | undefined; isFromNotificationClick?: boolean; // click by system notification banner navigation?: IAppNavigation; @@ -73,7 +75,9 @@ async function navigateToNotificationDetail({ accountAddress, transactionHash, notificationId, + notificationAccountId, checkIsFocused: false, + allowClickAccountNameSwitch: true, }; } }