mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-24 09:18:09 +00:00
Merge branch 'master' into fix-wallet-modals
This commit is contained in:
commit
5524080c30
@ -88,6 +88,8 @@ export function update(event: StorageEvent): AsyncAction {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const VERSION: string = '1';
|
||||||
|
|
||||||
export function loadTokensFromJSON(): AsyncAction {
|
export function loadTokensFromJSON(): AsyncAction {
|
||||||
return async (dispatch: Dispatch): Promise<void> => {
|
return async (dispatch: Dispatch): Promise<void> => {
|
||||||
if (typeof window.localStorage === 'undefined') return;
|
if (typeof window.localStorage === 'undefined') return;
|
||||||
@ -100,6 +102,13 @@ export function loadTokensFromJSON(): AsyncAction {
|
|||||||
dispatch(update(event));
|
dispatch(update(event));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// validate version
|
||||||
|
const version: ?string = get('version');
|
||||||
|
if (version !== VERSION) {
|
||||||
|
window.localStorage.clear();
|
||||||
|
dispatch(save('version', VERSION));
|
||||||
|
}
|
||||||
|
|
||||||
// load tokens
|
// load tokens
|
||||||
const tokens = await config.coins.reduce(async (promise: Promise<TokensCollection>, coin: Coin): Promise<TokensCollection> => {
|
const tokens = await config.coins.reduce(async (promise: Promise<TokensCollection>, coin: Coin): Promise<TokensCollection> => {
|
||||||
const collection: TokensCollection = await promise;
|
const collection: TokensCollection = await promise;
|
||||||
|
@ -159,73 +159,75 @@ const AccountReceive = (props: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Content>
|
<Content>
|
||||||
<H2>Receive Ethereum or tokens</H2>
|
<React.Fragment>
|
||||||
<AddressWrapper
|
<H2>Receive Ethereum or tokens</H2>
|
||||||
isShowingQrCode={addressVerified || addressUnverified}
|
<AddressWrapper
|
||||||
>
|
isShowingQrCode={addressVerified || addressUnverified}
|
||||||
{isAddressVerifying && (
|
|
||||||
<AddressInfoText>Confirm address on TREZOR</AddressInfoText>
|
|
||||||
)}
|
|
||||||
{((addressVerified || addressUnverified) && !isAddressVerifying) && (
|
|
||||||
<Tooltip
|
|
||||||
placement="left"
|
|
||||||
content={(
|
|
||||||
<VerifyAddressTooltip
|
|
||||||
isConnected={device.connected}
|
|
||||||
isAvailable={device.available}
|
|
||||||
addressUnverified={addressUnverified}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<EyeButton
|
|
||||||
isTransparent
|
|
||||||
onClick={() => props.showAddress(account.addressPath)}
|
|
||||||
>
|
|
||||||
|
|
||||||
<Icon
|
|
||||||
icon={addressUnverified ? ICONS.EYE_CROSSED : ICONS.EYE}
|
|
||||||
color={addressUnverified ? colors.ERROR_PRIMARY : colors.TEXT_PRIMARY}
|
|
||||||
/>
|
|
||||||
|
|
||||||
</EyeButton>
|
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
<ValueWrapper
|
|
||||||
isHidden={isAddressHidden}
|
|
||||||
isVerifying={isAddressVerifying}
|
|
||||||
>
|
>
|
||||||
{address}
|
{isAddressVerifying && (
|
||||||
</ValueWrapper>
|
<AddressInfoText>Confirm address on TREZOR</AddressInfoText>
|
||||||
{isAddressVerifying && (
|
)}
|
||||||
<React.Fragment>
|
{((addressVerified || addressUnverified) && !isAddressVerifying) && (
|
||||||
<ArrowUp />
|
<Tooltip
|
||||||
<AddressInfoText>
|
placement="left"
|
||||||
<Icon
|
content={(
|
||||||
icon={ICONS.T1}
|
<VerifyAddressTooltip
|
||||||
color={colors.WHITE}
|
isConnected={device.connected}
|
||||||
|
isAvailable={device.available}
|
||||||
|
addressUnverified={addressUnverified}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<EyeButton
|
||||||
|
isTransparent
|
||||||
|
onClick={() => props.showAddress(account.addressPath)}
|
||||||
|
>
|
||||||
|
|
||||||
|
<Icon
|
||||||
|
icon={addressUnverified ? ICONS.EYE_CROSSED : ICONS.EYE}
|
||||||
|
color={addressUnverified ? colors.ERROR_PRIMARY : colors.TEXT_PRIMARY}
|
||||||
|
/>
|
||||||
|
|
||||||
|
</EyeButton>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
<ValueWrapper
|
||||||
|
isHidden={isAddressHidden}
|
||||||
|
isVerifying={isAddressVerifying}
|
||||||
|
>
|
||||||
|
{address}
|
||||||
|
</ValueWrapper>
|
||||||
|
{isAddressVerifying && (
|
||||||
|
<React.Fragment>
|
||||||
|
<ArrowUp />
|
||||||
|
<AddressInfoText>
|
||||||
|
<Icon
|
||||||
|
icon={ICONS.T1}
|
||||||
|
color={colors.WHITE}
|
||||||
|
/>
|
||||||
|
Check address on your Trezor
|
||||||
|
</AddressInfoText>
|
||||||
|
</React.Fragment>
|
||||||
|
)}
|
||||||
|
{(addressVerified || addressUnverified) && (
|
||||||
|
<React.Fragment>
|
||||||
|
<Label>QR code</Label>
|
||||||
|
<StyledQRCode
|
||||||
|
bgColor="#FFFFFF"
|
||||||
|
fgColor="#000000"
|
||||||
|
level="Q"
|
||||||
|
style={{ width: 150 }}
|
||||||
|
value={account.address}
|
||||||
/>
|
/>
|
||||||
Check address on your Trezor
|
</React.Fragment>
|
||||||
</AddressInfoText>
|
)}
|
||||||
</React.Fragment>
|
{!(addressVerified || addressUnverified) && (
|
||||||
)}
|
<ShowAddressButton onClick={() => props.showAddress(account.addressPath)} isDisabled={device.connected && !discovery.completed}>
|
||||||
{(addressVerified || addressUnverified) && (
|
<ShowAddressIcon icon={ICONS.EYE} color={colors.WHITE} />Show full address
|
||||||
<React.Fragment>
|
</ShowAddressButton>
|
||||||
<Label>QR code</Label>
|
)}
|
||||||
<StyledQRCode
|
</AddressWrapper>
|
||||||
bgColor="#FFFFFF"
|
</React.Fragment>
|
||||||
fgColor="#000000"
|
|
||||||
level="Q"
|
|
||||||
style={{ width: 150 }}
|
|
||||||
value={account.address}
|
|
||||||
/>
|
|
||||||
</React.Fragment>
|
|
||||||
)}
|
|
||||||
{!(addressVerified || addressUnverified) && (
|
|
||||||
<ShowAddressButton onClick={() => props.showAddress(account.addressPath)} isDisabled={device.connected && !discovery.completed}>
|
|
||||||
<ShowAddressIcon icon={ICONS.EYE} color={colors.WHITE} />Show full address
|
|
||||||
</ShowAddressButton>
|
|
||||||
)}
|
|
||||||
</AddressWrapper>
|
|
||||||
</Content>
|
</Content>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user