Skip to content

Commit

Permalink
Merge pull request #965 from crypto-com/dev
Browse files Browse the repository at this point in the history
Internal Release v0.6.7
  • Loading branch information
crypto-matto authored Jan 30, 2022
2 parents a04d898 + adafe1c commit 1aad103
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 43 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
*Unreleased*

*Released*
## [v0.6.7] - 2022-01-28
### Bug fixes
- Incorrect delegation items
- Missing address index on Standard Wallets
- Remove unwanted Ledger notification popup on Standard Wallets

## [v0.6.6] - 2022-01-26
### Additions
- Full DApp Browser Support on Cronos
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chain-desktop-wallet",
"version": "0.6.6",
"version": "0.6.7",
"description": "Crypto.com Chain Desktop Wallet App",
"repository": "github:crypto-com/chain-desktop-wallet",
"author": "Crypto.org <[email protected]>",
Expand Down Expand Up @@ -342,6 +342,7 @@
"tar": "6.1.9",
"glob-parent": "6.0.2",
"json-schema": "0.4.0",
"follow-redirects": "1.14.7"
"follow-redirects": "1.14.7",
"simple-get": "4.0.1"
}
}
2 changes: 1 addition & 1 deletion src/pages/assets/components/FormSend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const FormSend: React.FC<FormSendProps> = props => {

const showPasswordInput = () => {
if (decryptedPhrase || currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
if (!isLedgerConnected) {
if (!isLedgerConnected && currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
ledgerNotification(currentSession.wallet, walletAsset!);
}
showConfirmationModal();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/governance/governance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const GovernancePage = () => {

const showPasswordInput = () => {
if (decryptedPhrase || currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
if (!isLedgerConnected) {
if (!isLedgerConnected && currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
ledgerNotification(currentSession.wallet, userAsset!);
}
showConfirmationModal();
Expand Down
6 changes: 3 additions & 3 deletions src/pages/nft/nft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const convertNftTransfers = (allTransfers: NftAccountTransactionData[]) => {

return allTransfers.map((transfer, idx) => {
const data: NftTransferTabularData = {
key: `${idx}-${transfer.transactionHash}-${transfer.data.recipient}-${transfer.data.denomId}-${transfer.data.tokenId}`,
key: `${idx}_${transfer.transactionHash}_${transfer.data.recipient}_${transfer.data.denomId}_${transfer.data.tokenId}`,
transactionHash: transfer.transactionHash,
messageType: getType(transfer),
denomId: transfer.data.denomId,
Expand Down Expand Up @@ -280,7 +280,7 @@ const FormMintNft = () => {

const showPasswordInput = () => {
if (decryptedPhrase || currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
if (!isLedgerConnected) {
if (!isLedgerConnected && currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
ledgerNotification(currentSession.wallet, walletAsset!);
}
showConfirmationModal();
Expand Down Expand Up @@ -1085,7 +1085,7 @@ const NftPage = () => {

const showPasswordInput = () => {
if (decryptedPhrase || currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
if (!isLedgerConnected) {
if (!isLedgerConnected && currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
ledgerNotification(currentSession.wallet, walletAsset!);
}
showConfirmationModal();
Expand Down
18 changes: 9 additions & 9 deletions src/pages/staking/staking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ const FormDelegationRequest = props => {

const showPasswordInput = () => {
if (decryptedPhrase || currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
if (!isLedgerConnected) {
if (!isLedgerConnected && currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
ledgerNotification(currentSession.wallet, walletAsset!);
}
showConfirmationModal();
Expand Down Expand Up @@ -682,7 +682,7 @@ const FormDelegationOperations = props => {

const showPasswordInput = () => {
if (decryptedPhrase || currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
if (!isLedgerConnected) {
if (!isLedgerConnected && currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
ledgerNotification(currentSession.wallet, defaultAsset!);
}
showConfirmationModal();
Expand Down Expand Up @@ -796,10 +796,10 @@ const FormDelegationOperations = props => {

function convertDelegations(allDelegations: StakingTransactionData[], currentAsset: UserAsset) {
return allDelegations
.map(dlg => {
.map((dlg, idx) => {
const stakedAmount = getUIDynamicAmount(dlg.stakedAmount, currentAsset);
const data: StakingTabularData = {
key: dlg.validatorAddress + dlg.stakedAmount,
key: `${idx}_${dlg.validatorAddress}_${dlg.stakedAmount}`,
delegatorAddress: dlg.delegatorAddress,
validatorAddress: dlg.validatorAddress,
stakedAmountWithSymbol: `${stakedAmount} ${currentAsset.symbol}`,
Expand Down Expand Up @@ -1074,7 +1074,7 @@ const FormWithdrawStakingReward = () => {
) => {
return allRewards
.filter(reward => Big(reward.amount).gte(Big(0)))
.map(reward => {
.map((reward, idx) => {
const rewardAmount = getUIDynamicAmount(reward.amount, currentAsset);
const marketPrice =
currentMarketPrice && currentMarketPrice.price ? new Big(currentMarketPrice.price) : '';
Expand All @@ -1083,7 +1083,7 @@ const FormWithdrawStakingReward = () => {
? new Big(rewardAmount).times(marketPrice).toFixed(2)
: '';
const rewardData: RewardsTabularData = {
key: `${reward.validatorAddress}${reward.amount}`,
key: `${idx}_${reward.validatorAddress}${reward.amount}`,
rewardAmount: `${rewardAmount} ${currentAsset.symbol}`,
rewardMarketPrice:
rewardMarketPrice !== '' && currentMarketPrice
Expand Down Expand Up @@ -1138,7 +1138,7 @@ const FormWithdrawStakingReward = () => {

const showPasswordInput = (action: string) => {
if (decryptedPhrase || currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
if (!isLedgerConnected) {
if (!isLedgerConnected && currentSession.wallet.walletType === LEDGER_WALLET_TYPE) {
ledgerNotification(currentSession.wallet, walletAsset!);
return;
}
Expand Down Expand Up @@ -1679,10 +1679,10 @@ const StakingPage = () => {
) => {
return (
allUnbondingDelegations
.map(dlg => {
.map((dlg, idx) => {
const unbondingAmount = getUIDynamicAmount(dlg.unbondingAmount, currentAsset);
const data: UnbondingDelegationTabularData = {
key: `${dlg.validatorAddress}_${dlg.unbondingAmount}_${dlg.completionTime}`,
key: `${idx}_${dlg.validatorAddress}_${dlg.unbondingAmount}_${dlg.completionTime}`,
delegatorAddress: dlg.delegatorAddress,
validatorAddress: dlg.validatorAddress,
completionTime: new Date(dlg.completionTime).toString(),
Expand Down
2 changes: 1 addition & 1 deletion src/pages/wallet/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function WalletPage() {
key: 'addressIndex',
children: [
{
title: session?.wallet.addressIndex,
title: session?.wallet.addressIndex.toString(),
dataIndex: 'addressIndex',
},
],
Expand Down
11 changes: 9 additions & 2 deletions src/storage/StorageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,14 @@ export class StorageService {
},
};

// await this.updateCommonAttributes()
// Manually remove `staking` records first
await this.db.commonTransactionStore.remove({
walletId: stakingTransactions.walletId,
txType: 'staking'
}, {
multi: true
});

await this.insertCommonTransactionRecords(stakingTxRecords);

// Insert to common Attributes store
Expand Down Expand Up @@ -420,7 +427,7 @@ export class StorageService {
type: 'staking',
},
);

return {
transactions: stakingTxRecord.map(tx => tx.txData),
walletId,
Expand Down
39 changes: 15 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6326,12 +6326,12 @@ decompress-response@^3.2.0, decompress-response@^3.3.0:
dependencies:
mimic-response "^1.0.0"

decompress-response@^4.2.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-4.2.1.tgz"
integrity sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==
decompress-response@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc"
integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==
dependencies:
mimic-response "^2.0.0"
mimic-response "^3.1.0"

dedent@^0.7.0:
version "0.7.0"
Expand Down Expand Up @@ -11287,10 +11287,10 @@ mimic-response@^1.0.0, mimic-response@^1.0.1:
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz"
integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==

mimic-response@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.1.0.tgz"
integrity sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==
mimic-response@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9"
integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==

min-document@^2.19.0:
version "2.19.0"
Expand Down Expand Up @@ -14389,7 +14389,7 @@ readonly-date@^1.0.0:
resolved "https://registry.yarnpkg.com/readonly-date/-/readonly-date-1.0.0.tgz"
integrity sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==

recoil-nexus@^0.3.15:
[email protected]:
version "0.3.15"
resolved "https://registry.yarnpkg.com/recoil-nexus/-/recoil-nexus-0.3.15.tgz#82e9b916409aef53cf2b2cc2dbae26b331f1a893"
integrity sha512-UrV1VWZskAa/bvLmLc/W/DN11GkL9WGrB5heAtgiz8XLWvyUFfJr20uM4c7YIsssO7g1zDfM4MfbAldbGYWMYQ==
Expand Down Expand Up @@ -15278,21 +15278,12 @@ simple-concat@^1.0.0:
resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz"
integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==

simple-get@^2.7.0:
version "2.8.1"
resolved "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz"
integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==
dependencies:
decompress-response "^3.3.0"
once "^1.3.1"
simple-concat "^1.0.0"

simple-get@^3.0.3:
version "3.1.0"
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-3.1.0.tgz"
integrity sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==
[email protected], simple-get@^2.7.0, simple-get@^3.0.3:
version "4.0.1"
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543"
integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==
dependencies:
decompress-response "^4.2.0"
decompress-response "^6.0.0"
once "^1.3.1"
simple-concat "^1.0.0"

Expand Down

0 comments on commit 1aad103

Please sign in to comment.