Skip to content

Commit

Permalink
[Release] New release 2.22.0 (minor) (#10534)
Browse files Browse the repository at this point in the history
* refactor: code style

* fix: tablist next arrow (#10546)

* fix: tablist next arrow

* fix: typo

* fix: pnpm-lock.yaml

* fix: lint error

* fix: reply review

* fix: more/dao tab width

* chore: revert lock file

* chore: revert lock file

---------

Co-authored-by: guanbinrui <guanbinrui@dimension.im>

* fix: chain only detection (#10578)

* chore: update wallet db key (#10579)

* fix: trending currency and ui (#10582)

* fix: dashboard reset (#10588)

* chore: remove useless notification (#10587)

* fix: mf-5131 allow to scroll in nft detail dialog (#10586)

* chore: grammar: Management network -> Manage Network

* fix: mf-5131 allow to scroll in nft detail dialog

* fix: nft detail ui (#10585)

* fix: nft detail ui

* fix: mf-5108 popup nft tooltip (#10543)

* fix: mf-5108 popup nft tooltip

* fix: mf-5108 popup nft tooltip

* fix: mf-5133 (#10589)

* chore: reset magic number of re-render (#10591)

* fix: remove unnecessary pasword required (#10592)

* fix: bugfix for onboarding (#10593)

* chore: use one time password to generate address (#10595)

* refactor: wallet db (#10594)

* fix: one time pwd

* fix(ui): height of settings

* refactor: icon & texture

* fix: add contract icon

* fix: pets in 3d (#10596)

* fix: bugfix for avatar setting (#10597)

* fix: bugfix for select wallet (#10598)

* fix: bugfix for select wallet

* fix: hidden switch network when wallet be smart pay

---------

Co-authored-by: guanbinrui <52657989+guanbinrui@users.noreply.github.com>

* fix: bugfix for wallet setting ui (#10599)

---------

Co-authored-by: lelenei <72531217+lelenei@users.noreply.github.com>
Co-authored-by: UncleBill <billbill290@gmail.com>
Co-authored-by: nuanyang233 <nuanyang233@gmail.com>
Co-authored-by: Hancheng Zhou <z308114274@gmail.com>
Co-authored-by: Harlan Sun <33143119+beyond009@users.noreply.github.com>
  • Loading branch information
6 people committed Aug 23, 2023
1 parent 551c9d0 commit c5fda47
Show file tree
Hide file tree
Showing 45 changed files with 288 additions and 158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const CreateMnemonic = memo(function CreateMnemonic() {
}, [words.join(' '), walletName, hasPassword])

const [{ loading }, onSubmit] = useAsyncFn(async () => {
handlePasswordAndWallets(location.state?.password, location.state?.isReset)
await handlePasswordAndWallets(location.state?.password, location.state?.isReset)

const address = await WalletServiceRef.value.createWalletFromMnemonicWords(walletName, words.join(' '))
await WalletServiceRef.value.resolveMaskAccount([
Expand Down Expand Up @@ -335,7 +335,7 @@ const VerifyMnemonicUI = memo<VerifyMnemonicUIProps>(function VerifyMnemonicUI({
size="large"
color="primary"
onClick={() => verifyAnswerCallback(onSubmit)}>
{isReset ? t.restore() : t.verify()}
{t.verify()}
</PrimaryButton>
</div>
</SetupFrameController>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const CreateWalletForm = memo(function CreateWalletForm() {
return (
<div className={classes.container}>
<Typography className={cx(classes.second, classes.bold)}>
{t.create_step({ step: '1', totalSteps: '3' })}
{!isReset ? t.create_step({ step: '1', totalSteps: '3' }) : null}
</Typography>
<Typography className={cx(classes.title, classes.bold)}>{t.set_payment_password()}</Typography>
<Typography className={classes.tips}>{t.create_wallet_payment_password_tip_1()}</Typography>
Expand Down
15 changes: 13 additions & 2 deletions packages/dashboard/src/pages/SetupPersona/Onboarding/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { memo, useCallback, useMemo } from 'react'
import { memo, useCallback, useEffect, useMemo } from 'react'
import { useDashboardI18N } from '../../../locales/i18n_generated.js'
import { Box, Typography } from '@mui/material'
import { SetupFrameController } from '../../../components/SetupFrame/index.js'
import { PrimaryButton } from '../../../components/PrimaryButton/index.js'
import { makeStyles, useCustomSnackbar } from '@masknet/theme'
import { Icons } from '@masknet/icons'
import { Trend } from '../../../assets/index.js'
import { EnhanceableSite, PopupRoutes } from '@masknet/shared-base'
import { CrossIsolationMessages, EnhanceableSite, PopupRoutes } from '@masknet/shared-base'

import { Services } from '../../../API.js'
import { delay } from '@masknet/kit'
Expand Down Expand Up @@ -103,6 +103,17 @@ export const Onboarding = memo(function Onboarding() {
)
}, [hasPaymentPassword])

useEffect(() => {
return CrossIsolationMessages.events.passwordStatusUpdated.on((hasPassword) => {
if (!hasPassword) return
retry()
showSnackbar(t.persona_onboarding_set_payment_password(), {
variant: 'success',
message: t.wallet_set_payment_password_successfully(),
})
})
}, [retry])

const words = useMemo(() => {
const count = params.get('count')
return compact([
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/general/WalletSetting.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/icons/icon-generated-as-jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -3206,7 +3206,7 @@ export const WalletSetting = /*#__PURE__*/ __createIcon('WalletSetting', [
j: () =>
/*#__PURE__*/ _jsx('svg', {
xmlns: 'http://www.w3.org/2000/svg',
viewBox: '0 0 24 24',
viewBox: '0 0 20 20',
children: /*#__PURE__*/ _jsxs('g', {
fill: 'currentColor',
children: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import { createPluginDatabase } from '../../../database/plugin-db/wrap-plugin-da
import { PluginID } from '@masknet/shared-base'

// Note: Wallet was a plugin in the past, but now it's a core service in Mask.
export const walletDatabase = createPluginDatabase<WalletRecord | SecretRecord | LockerRecord>(PluginID.WalletService)
export const walletDatabase = createPluginDatabase<WalletRecord | SecretRecord | LockerRecord>(PluginID.Wallet)
Original file line number Diff line number Diff line change
Expand Up @@ -349,16 +349,16 @@ export async function generateAddressFromMnemonicWords(
mnemonic: string,
derivationPath = `${HD_PATH_WITHOUT_INDEX_ETHEREUM}/0`,
) {
const masterPassword = await password.INTERNAL_getMasterPasswordRequired()
const oneTimePassword = 'MASK'
const imported = await Mask.importMnemonic({
mnemonic,
password: masterPassword,
password: oneTimePassword,
})
if (!imported?.StoredKey) throw new Error('Failed to import the wallet.')
const created = await Mask.createAccountOfCoinAtPath({
coin: api.Coin.Ethereum,
name,
password: masterPassword,
password: oneTimePassword,
derivationPath,
StoredKeyData: imported.StoredKey.data,
})
Expand Down
17 changes: 5 additions & 12 deletions packages/mask/shared-ui/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
"search_box_placeholder": "Type here to search",
"select_all": "Select All",
"nonce": "Nonce",
"none": "None",
"none": "N/A",
"select_none": "Select None",
"all_friends": "All Friends",
"select_specific_friends_dialog__title": "Share with",
Expand Down Expand Up @@ -493,7 +493,6 @@
"plugin_trader_dear_user": "Dear Users,",
"plugin_trader_user_warning": "Clicking the confirm button means that you agree to take the potential risks and proceed with the transaction.",
"plugin_trader_price_updated": "The price has expired.",
"plugin_trader_usdc_price_statistic": "Price Statistic",
"plugin_trader_market_statistic": "Market Statistic",
"plugin_trader_floor_price": "Floor Price",
"plugin_trader_trending": "Trending",
Expand Down Expand Up @@ -535,14 +534,8 @@
"plugin_trader_tab_exchange": "Exchange",
"plugin_trader_tab_activities": "Activities",
"plugin_trader_nft_items": "NFTs",
"plugin_trader_tab_swap": "Swap",
"plugin_trader_table_exchange": "Exchange",
"plugin_trader_table_pair": "Pair",
"plugin_trader_table_price": "Price",
"plugin_trader_table_volume": "Volume (24h)",
"plugin_trader_table_nft": "NFT",
"plugin_trader_table_method": "Method",
"plugin_trader_table_updated": "Updated",
"plugin_trader_table_value": "Value",
"plugin_trader_table_from": "From",
"plugin_trader_table_to": "To",
Expand Down Expand Up @@ -871,8 +864,8 @@
"popups_create_wallet": "Create Wallet",
"popups_back_up_the_wallet": "Back up the wallet",
"popups_recovery_wallet": "Wallet Recovered",
"popups_wallet_setting": "Wallet settings",
"popups_wallet_settings_change_network": "Change network",
"popups_wallet_setting": "Wallet Settings",
"popups_wallet_settings_change_network": "Change Network",
"popups_wallet_settings_auto_unlock_time": "Auto-lock Time",
"popups_wallet_settings_auto_unlock_time_mins": "{{time}} Mins",
"popups_wallet_settings_auto_unlock_time_title": "Auto-lock",
Expand Down Expand Up @@ -1214,7 +1207,7 @@
"plugin_wallet_connect_fortmatic": "Connect Fortmatic",
"plugin_wallet_choose_network": "Choose Network",
"plugin_disabled_tip": "You need to open the DAPP to view the specific content.",
"management_network": "Management network",
"manage_network": "Manage Network",
"network_management_add_network": "Add Network",
"network_name": "Network Name",
"rpc_url": "RPC URL",
Expand Down Expand Up @@ -1282,7 +1275,7 @@
"transaction_confirmed_at": "The transaction was confirmed at {{- datetime}}",
"transaction_completed_at": "The transaction was complete and has been recorded on blockchain at {{- datetime}}",
"collectible_title": "Collectible",
"collectible_description": "Desciptioin",
"collectible_description": "Description",
"collectible_properties": "Properties",
"collectible_last_sale_price": "Properties",
"about_collection": "Abount {{- name}}",
Expand Down
6 changes: 0 additions & 6 deletions packages/mask/shared-ui/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,6 @@
"plugin_trader_tab_market": "一般",
"plugin_trader_tab_price": "価格",
"plugin_trader_tab_exchange": "取引所",
"plugin_trader_tab_swap": "スワップ 🔥",
"plugin_trader_table_exchange": "ソース",
"plugin_trader_table_pair": "通貨ペア",
"plugin_trader_table_price": "価格",
"plugin_trader_table_volume": "取引高(24時間)",
"plugin_trader_table_updated": "更新",
"plugin_trader_error_amount_absence": "量を入力してください。",
"plugin_trader_error_insufficient_balance": "{{symbol}} の残高が足りません",
"plugin_trader_error_insufficient_lp": "流動性が足りません",
Expand Down
7 changes: 0 additions & 7 deletions packages/mask/shared-ui/locales/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@
"plugin_trader_dear_user": "안녕하세요 유저님,",
"plugin_trader_user_warning": "확인 버튼을 클릭하면 잠재적 위험을 감수하고 거래를 진행하는 데 동의한다는 말입니다.",
"plugin_trader_price_updated": "가격은 업데이트뒤었습니다",
"plugin_trader_usdc_price_statistic": "가격 통계",
"plugin_trader_market_statistic": "마켓 통계",
"plugin_trader_floor_price": "바닥 가격",
"plugin_trader_trending": "추세",
Expand Down Expand Up @@ -461,14 +460,8 @@
"plugin_trader_tab_exchange": "교환",
"plugin_trader_tab_activities": "활동",
"plugin_trader_nft_items": "NFTs",
"plugin_trader_tab_swap": "스왑 🔥",
"plugin_trader_table_exchange": "교환",
"plugin_trader_table_pair": "",
"plugin_trader_table_price": "가격",
"plugin_trader_table_volume": "거래량(24h)",
"plugin_trader_table_nft": "NFT",
"plugin_trader_table_method": "방법",
"plugin_trader_table_updated": "업데이트",
"plugin_trader_table_value": "",
"plugin_trader_table_from": "보낸 사람",
"plugin_trader_table_to": "받는 사람",
Expand Down
7 changes: 0 additions & 7 deletions packages/mask/shared-ui/locales/qya-AA.json
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@
"plugin_trader_dear_user": "crwdns17734:0crwdne17734:0",
"plugin_trader_user_warning": "crwdns17736:0crwdne17736:0",
"plugin_trader_price_updated": "crwdns10237:0crwdne10237:0",
"plugin_trader_usdc_price_statistic": "crwdns17666:0crwdne17666:0",
"plugin_trader_market_statistic": "crwdns18128:0crwdne18128:0",
"plugin_trader_floor_price": "crwdns18130:0crwdne18130:0",
"plugin_trader_trending": "crwdns19347:0crwdne19347:0",
Expand Down Expand Up @@ -535,14 +534,8 @@
"plugin_trader_tab_exchange": "crwdns4895:0crwdne4895:0",
"plugin_trader_tab_activities": "crwdns19359:0crwdne19359:0",
"plugin_trader_nft_items": "crwdns18140:0crwdne18140:0",
"plugin_trader_tab_swap": "crwdns4897:0crwdne4897:0",
"plugin_trader_table_exchange": "crwdns4899:0crwdne4899:0",
"plugin_trader_table_pair": "crwdns4901:0crwdne4901:0",
"plugin_trader_table_price": "crwdns4903:0crwdne4903:0",
"plugin_trader_table_volume": "crwdns4905:0crwdne4905:0",
"plugin_trader_table_nft": "crwdns19361:0crwdne19361:0",
"plugin_trader_table_method": "crwdns19363:0crwdne19363:0",
"plugin_trader_table_updated": "crwdns4907:0crwdne4907:0",
"plugin_trader_table_value": "crwdns19365:0crwdne19365:0",
"plugin_trader_table_from": "crwdns19367:0crwdne19367:0",
"plugin_trader_table_to": "crwdns19369:0crwdne19369:0",
Expand Down
7 changes: 0 additions & 7 deletions packages/mask/shared-ui/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@
"plugin_trader_dear_user": "尊敬的用户,",
"plugin_trader_user_warning": "点击确认按钮意味着您同意承担潜在的风险并选择继续进行交易。",
"plugin_trader_price_updated": "价格已更新",
"plugin_trader_usdc_price_statistic": "价值数据统计",
"plugin_trader_market_statistic": "市场数据统计",
"plugin_trader_floor_price": "地板价",
"plugin_trader_trending": "趋势",
Expand Down Expand Up @@ -535,14 +534,8 @@
"plugin_trader_tab_exchange": "交易",
"plugin_trader_tab_activities": "活动",
"plugin_trader_nft_items": "NFTs",
"plugin_trader_tab_swap": "兑换",
"plugin_trader_table_exchange": "交易所",
"plugin_trader_table_pair": "交易对",
"plugin_trader_table_price": "价格",
"plugin_trader_table_volume": "交易量 (24h)",
"plugin_trader_table_nft": "NFT",
"plugin_trader_table_method": "操作",
"plugin_trader_table_updated": "更新时间",
"plugin_trader_table_value": "价值",
"plugin_trader_table_from": "",
"plugin_trader_table_to": "",
Expand Down
6 changes: 0 additions & 6 deletions packages/mask/shared-ui/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,6 @@
"plugin_trader_tab_market": "一般",
"plugin_trader_tab_price": "價格",
"plugin_trader_tab_exchange": "交易所",
"plugin_trader_tab_swap": "交換",
"plugin_trader_table_exchange": "交易所",
"plugin_trader_table_pair": "交易對",
"plugin_trader_table_price": "價格",
"plugin_trader_table_volume": "交易量 (24h)",
"plugin_trader_table_updated": "已更新",
"plugin_trader_error_amount_absence": "輸入一個金額",
"plugin_trader_error_insufficient_balance": "{{symbol}} 餘額不足",
"plugin_trader_error_insufficient_lp": "本次交易流動性不足",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function SelectRecipientsUI(props: SelectRecipientsUIProps) {
const currentIdentity = useCurrentIdentity()
const type = resolveNextIDPlatform(valueToSearch)
const _value = resolveValueToSearch(valueToSearch)
const { isLoading: searchLoading, data: NextIDResults } = usePersonasFromNextID(
const { isFetching: searchLoading, data: NextIDResults } = usePersonasFromNextID(
_value,
type ?? NextIDPlatform.NextID,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export function useContacts(network: string): AsyncStateRetry<ProfileInformation
if (values.length === 0) return EMPTY_LIST

const identifiers = values.map((x) => x.profile).filter(isProfileIdentifier)
return Services.Identity.queryProfilesInformation(identifiers)
return (await Services.Identity.queryProfilesInformation(identifiers)).filter((x) => x.linkedPersona)
}, [network, currentPersona])
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ export const NFTAvatarPicker = memo<NFTAvatarPickerProps>(function NFTAvatarPick

const { account, chainId, setAccount, setChainId } = useChainContext()

const { value: assets, done, next, error, retry, loading } = useNonFungibleAssets(pluginID)
const {
value: assets,
done,
next,
error,
retry,
loading,
} = useNonFungibleAssets(pluginID, undefined, { chainId, account })

const tokens = useMemo(() => {
return uniqBy(assets, (x) => x.contract?.address.toLowerCase() + x.tokenId).filter((x) => x.chainId === chainId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const ChooseNetworkModal = memo(function ChooseNetworkModal({ ...rest }:

const action = (
<ActionButton fullWidth onClick={() => navigate(PopupRoutes.NetworkManagement)}>
Management network
{t('manage_network')}
</ActionButton>
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react'
import { useAsyncFn, useUnmount } from 'react-use'
import { useAsyncFn } from 'react-use'
import { useNavigate } from 'react-router-dom'
import {
type EnhanceableSite,
Expand Down Expand Up @@ -200,12 +200,9 @@ const AccountDetail = memo(() => {
/>
),
)
return () => setExtension(undefined)
}, [selectedAccount, handleDetachProfile, currentPersona, handleConfirmReleaseBind])

useUnmount(() => {
setExtension(null)
})

useUpdateEffect(() => {
setPendingUnlistedConfig(unlistedAddressConfig)
}, [JSON.stringify(unlistedAddressConfig)])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { PopupRoutes } from '@masknet/shared-base'
import { useUpdateEffect } from '@react-hookz/web'
import { memo, useContext } from 'react'
import { useUpdateEffect } from '@react-hookz/web'
import { PopupRoutes } from '@masknet/shared-base'
import { PersonaContext } from '@masknet/shared'
import { useLocation, useMatch } from 'react-router-dom'
import { NormalHeader } from '../../../../components/index.js'
import { PageTitleContext } from '../../../../context.js'
import { PersonaContext } from '@masknet/shared'
import { PersonaHeaderUI } from './UI.js'

export const PersonaHeader = memo(function PersonaHeader() {
Expand All @@ -15,6 +15,7 @@ export const PersonaHeader = memo(function PersonaHeader() {
const matchWalletConnect = useMatch(PopupRoutes.WalletConnect)
const matchProfilePhoto = useMatch(PopupRoutes.PersonaAvatarSetting)
const matchSignRequest = useMatch(PopupRoutes.PersonaSignRequest)

useUpdateEffect(() => {
setExtension(undefined)
}, [location.pathname, setExtension])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Persona = memo(() => {
return CrossIsolationMessages.events.popupWalletConnectEvent.on(({ open, uri }) => {
if (!open || location.href.includes(PopupRoutes.WalletConnect)) return
navigate(PopupRoutes.WalletConnect, {
replace: true,
replace: location.hash.includes('/modal/select-provider'),
state: {
uri,
},
Expand Down

0 comments on commit c5fda47

Please sign in to comment.