Skip to content

Commit

Permalink
Merge pull request ava-labs#159 from ava-labs/dev
Browse files Browse the repository at this point in the history
Fix Advanced page import X bug
  • Loading branch information
kanatliemre authored Feb 10, 2021
2 parents 6c1fb52 + 6bab615 commit 2f25b8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 13 additions & 2 deletions src/components/wallet/advanced/ChainImport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p>{{ $t('advanced.import.desc') }}</p>
<div v-if="isSuccess" class="is_success">
<label>Tx ID</label>
<p>{{ txId }}</p>
<p style="word-break: break-all; font-size: 13px">{{ txId }}</p>
</div>
<p class="err" v-else-if="err">{{ err }}</p>
<template v-if="!isLoading">
Expand Down Expand Up @@ -57,14 +57,25 @@ export default class ChainImport extends Vue {
async atomicImportX() {
this.beforeSubmit()
if (!this.wallet) return
// Import from P
try {
let txId = await this.wallet.importToXChain('P')
this.onSuccess(txId)
} catch (e) {
if (this.isSuccess) return
this.onError(e)
}
// Import from C
try {
// TODO: Change after ledger support
if (this.wallet.type !== 'ledger') {
let txId2 = await this.wallet.importToXChain('C')
this.onSuccess(txId2)
}
this.onSuccess(txId)
} catch (e) {
if (this.isSuccess) return
this.onError(e)
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/wallet/earn/ChainTransfer/ChainTransfer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ export default class ChainTransfer extends Vue {
// STEP 3
async chainImport() {
let wallet: AvaHdWallet = this.$store.state.activeWallet
let importTxId
try {
if (this.targetChain === 'P') {
Expand Down

0 comments on commit 2f25b8e

Please sign in to comment.