Skip to content

Commit

Permalink
Web3 UI fixes and signer error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
udaybansal19 committed Jul 28, 2024
1 parent cf7c8c4 commit aca2807
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,17 @@ export const signPdf = async (

const toSign = buf.toString('hex')

return new Promise((resolve) => {
return new Promise((resolve, reject) => {
; (chrome as any).pkcs11.getSignature(
hsmPath,
pin,
toSign,
(sig: string) => {
getPkcs11ErrorHandler(sig)
try {
getPkcs11ErrorHandler(sig)
} catch (error) {
reject(error)
}
let signature = Buffer.from(sig, 'hex').toString('binary')
resolve(signature)
}
Expand Down
4 changes: 2 additions & 2 deletions components/brave_wallet/browser/brave_wallet_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
kDefaultSolanaWallet,
static_cast<int>(
brave_wallet::mojom::DefaultWallet::BraveWalletPreferExtension));
registry->RegisterStringPref(kDefaultBaseCurrency, "USD");
registry->RegisterStringPref(kDefaultBaseCryptocurrency, "BTC");
registry->RegisterStringPref(kDefaultBaseCurrency, "INR");
registry->RegisterStringPref(kDefaultBaseCryptocurrency, "SOL");
registry->RegisterBooleanPref(kShowWalletIconOnToolbar, true);
registry->RegisterDictionaryPref(kBraveWalletTransactions);
registry->RegisterDictionaryPref(kBraveWalletP3AActiveWalletDict);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ import {
BackgroundWatermark,
BalanceAndLineChartWrapper
} from './style'
import { Column, Row, HorizontalSpace } from '../../../shared/style'
import { Column, Row } from '../../../shared/style'

// Queries
import {
Expand Down Expand Up @@ -618,15 +618,15 @@ export const PortfolioOverview = () => {
</>
) : (
<>
<LoadingSkeleton
{/* <LoadingSkeleton
width={55}
height={24}
/>
<HorizontalSpace space='8px' />
<LoadingSkeleton
width={55}
height={24}
/>
/> */}
</>
)}
</Row>
Expand Down
36 changes: 18 additions & 18 deletions components/brave_wallet_ui/options/nav-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,24 @@ export const isValidPanelNavigationOption = (
}

export const BuySendSwapDepositOptions: NavOption[] = [
{
id: 'buy',
name: 'braveWalletBuy',
icon: 'coins-alt1',
route: WalletRoutes.FundWalletPageStart
},
// {
// id: 'buy',
// name: 'braveWalletBuy',
// icon: 'coins-alt1',
// route: WalletRoutes.FundWalletPageStart
// },
{
id: 'send',
name: 'braveWalletSend',
icon: 'send',
route: WalletRoutes.Send
},
{
id: 'swap',
name: 'braveWalletSwap',
icon: 'currency-exchange',
route: WalletRoutes.Swap
},
// {
// id: 'swap',
// name: 'braveWalletSwap',
// icon: 'currency-exchange',
// route: WalletRoutes.Swap
// },
{
id: 'deposit',
name: 'braveWalletDepositCryptoButton',
Expand Down Expand Up @@ -112,12 +112,12 @@ export const NavOptions: NavOption[] = [
icon: 'user-accounts',
route: WalletRoutes.Accounts
},
{
id: 'market',
name: 'braveWalletTopNavMarket',
icon: 'discover',
route: WalletRoutes.Market
}
// {
// id: 'market',
// name: 'braveWalletTopNavMarket',
// icon: 'discover',
// route: WalletRoutes.Market
// }
]

export const AllNavOptions: NavOption[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useOnClickOutside } from '../../../../common/hooks/useOnClickOutside'
// Styled Components
import {
HeaderWrapper,
BraveLogo,
// BraveLogo,
SettingsButton,
SettingsIcon,
SettingsWrapper
Expand Down Expand Up @@ -50,7 +50,7 @@ export const TabHeader = (props: Props) => {
rowHeight='full'
verticalAlign='center'
>
<BraveLogo />
{/* <BraveLogo /> */}
</Row>
{!hideHeaderMenu && (
<SettingsWrapper ref={settingsModalRef}>
Expand Down

0 comments on commit aca2807

Please sign in to comment.