mirror of
https://github.com/zhigang1992/xverse-web-extension.git
synced 2026-04-29 21:26:07 +08:00
Merge pull request #764 from secretkeylabs/release/v0.45.1
release: v0.45.1 to main
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "xverse-web-extension",
|
||||
"version": "0.45.0",
|
||||
"version": "0.45.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "xverse-web-extension",
|
||||
"version": "0.45.0",
|
||||
"version": "0.45.1",
|
||||
"dependencies": {
|
||||
"@aryzing/superqs": "0.0.6",
|
||||
"@ledgerhq/hw-transport-webusb": "^6.27.13",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "xverse-web-extension",
|
||||
"description": "A Bitcoin wallet for Web3",
|
||||
"version": "0.45.0",
|
||||
"version": "0.45.1",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": "^18.18.2"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import AccountRow from '@components/accountRow';
|
||||
import useWalletReducer from '@hooks/useWalletReducer';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import OptionsDialog from '@components/optionsDialog/optionsDialog';
|
||||
@@ -64,7 +64,6 @@ function AccountHeaderComponent({
|
||||
disableAccountSwitch = false,
|
||||
}: Props) {
|
||||
const navigate = useNavigate();
|
||||
const { pathname } = useLocation();
|
||||
const selectedAccount = useSelectedAccount();
|
||||
const menuDialog = useOptionsDialog();
|
||||
|
||||
@@ -75,7 +74,7 @@ function AccountHeaderComponent({
|
||||
|
||||
const handleAccountSelect = () => {
|
||||
if (!disableAccountSwitch) {
|
||||
navigate(RoutePaths.AccountList, { state: { from: pathname } });
|
||||
navigate(RoutePaths.AccountList);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import ScreenContainer from '@components/screenContainer';
|
||||
import { animated, useSpring } from '@react-spring/web';
|
||||
import { ANIMATION_EASING } from '@utils/constants';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
const containerStyles = {
|
||||
display: 'flex',
|
||||
@@ -12,10 +11,9 @@ const containerStyles = {
|
||||
};
|
||||
|
||||
function AnimatedScreenContainer(): JSX.Element {
|
||||
const location = useLocation();
|
||||
const { state } = location;
|
||||
|
||||
const shouldAnimate = state?.from === '/login';
|
||||
// TODO: figure this out to make animations work
|
||||
// TODO: they should only load if coming fromm the login page
|
||||
const shouldAnimate = false;
|
||||
|
||||
const styles = useSpring({
|
||||
from: {
|
||||
|
||||
@@ -3,7 +3,7 @@ import useWalletReducer from '@hooks/useWalletReducer';
|
||||
import useWalletSelector from '@hooks/useWalletSelector';
|
||||
import Spinner from '@ui-library/spinner';
|
||||
import { useEffect, type PropsWithChildren } from 'react';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import styled from 'styled-components';
|
||||
|
||||
const CenterChildContainer = styled.div`
|
||||
@@ -24,7 +24,6 @@ const isInitialised = {
|
||||
|
||||
function AuthGuard({ children }: PropsWithChildren) {
|
||||
const navigate = useNavigate();
|
||||
const { pathname } = useLocation();
|
||||
const { encryptedSeed, isUnlocked, accountsList } = useWalletSelector();
|
||||
const { loadWallet, lockWallet } = useWalletReducer();
|
||||
const seedVault = useSeedVault();
|
||||
@@ -41,7 +40,7 @@ function AuthGuard({ children }: PropsWithChildren) {
|
||||
if (encryptedSeed) {
|
||||
// this is a legacy seed store. If it exists, we need to migrate
|
||||
// it to the new seed vault which happens on login
|
||||
navigate('/login', { state: { from: pathname } });
|
||||
navigate('/login');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -64,7 +63,7 @@ function AuthGuard({ children }: PropsWithChildren) {
|
||||
try {
|
||||
await seedVault.getSeed();
|
||||
} catch (error) {
|
||||
navigate('/login', { state: { from: pathname } });
|
||||
navigate('/login');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ const StarIconContainer = styled.div((props) => ({
|
||||
type AddressBalanceProps = {
|
||||
balance: number | undefined;
|
||||
addressType: BtcAddressType | undefined;
|
||||
totalBalance: number | undefined;
|
||||
totalBalance?: number | undefined;
|
||||
};
|
||||
|
||||
export default function AddressBalance({
|
||||
@@ -102,7 +102,9 @@ export default function AddressBalance({
|
||||
<StyledP typography="body_bold_m">BTC</StyledP>
|
||||
{addressType && <BtcAddressTypeLabel addressType={addressType} />}
|
||||
</AddressTypeContainer>
|
||||
<StyledP typography="body_m" color="white_200">{`${balancePercentage}%`}</StyledP>
|
||||
<StyledP typography="body_m" color="white_200">
|
||||
{totalBalance !== undefined ? `${balancePercentage}%` : ''}
|
||||
</StyledP>
|
||||
</TitleContainer>
|
||||
<BalanceContainer>
|
||||
<StyledP typography="body_bold_m">
|
||||
|
||||
@@ -43,11 +43,7 @@ export default function BalanceBreakdown() {
|
||||
totalBalance={confirmedPaymentBalance}
|
||||
/>
|
||||
)}
|
||||
<AddressBalance
|
||||
balance={taprootBalance?.confirmedBalance}
|
||||
addressType="taproot"
|
||||
totalBalance={confirmedPaymentBalance}
|
||||
/>
|
||||
<AddressBalance balance={taprootBalance?.confirmedBalance} addressType="taproot" />
|
||||
</SecondaryContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ function AuthenticationRequest() {
|
||||
stxAddress: {
|
||||
mainnet: selectedAccount.stxAddress,
|
||||
testnet: publicKeyToAddress(AddressVersion.MainnetSingleSig, {
|
||||
data: Buffer.from(selectedAccount.stxPublicKey, 'hex'),
|
||||
data: Uint8Array.from(Buffer.from(selectedAccount.stxPublicKey, 'hex')),
|
||||
type: StacksMessageType.PublicKey,
|
||||
}),
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@ import { trackMixPanel } from '@utils/mixpanel';
|
||||
import RoutePaths from 'app/routes/paths';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import AddressPurposeBox from '../addressPurposeBox';
|
||||
import PermissionsList from '../permissionsList';
|
||||
import {
|
||||
@@ -34,7 +34,6 @@ import useBtcAddressRequest from './useBtcAddressRequest';
|
||||
function BtcSelectAddressScreen() {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const navigate = useNavigate();
|
||||
const { pathname } = useLocation();
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'SELECT_BTC_ADDRESS_SCREEN' });
|
||||
const selectedAccount = useSelectedAccount();
|
||||
const { network } = useWalletSelector();
|
||||
|
||||
@@ -11,7 +11,7 @@ import Button from '@ui-library/button';
|
||||
import { trackMixPanel } from '@utils/mixpanel';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import {
|
||||
AppVersion,
|
||||
ButtonContainer,
|
||||
@@ -31,7 +31,6 @@ import {
|
||||
function Login(): JSX.Element {
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'LOGIN_SCREEN' });
|
||||
const navigate = useNavigate();
|
||||
const { state } = useLocation();
|
||||
const { unlockWallet } = useWalletReducer();
|
||||
const { hasSeed } = useSeedVault();
|
||||
const { migrateCachedStorage, isVaultUpdated } = useSeedVaultMigration();
|
||||
@@ -89,19 +88,11 @@ function Login(): JSX.Element {
|
||||
setShowMigration(true);
|
||||
} else {
|
||||
setIsVerifying(false);
|
||||
if (state?.from) {
|
||||
navigate(state?.from, { state: { from: '/login' } }); // this is needed for AnimatedScreenContainer where we check the state.from
|
||||
} else {
|
||||
navigate(-1);
|
||||
}
|
||||
navigate(-1);
|
||||
}
|
||||
} catch (err) {
|
||||
setIsVerifying(false);
|
||||
if (state?.from) {
|
||||
navigate(state?.from, { state: { from: '/login' } }); // this is needed for AnimatedScreenContainer where we check the state.from
|
||||
} else {
|
||||
navigate(-1);
|
||||
}
|
||||
navigate(-1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user