Skip to content

Commit 6bab615

Browse files
authored
Merge pull request ava-labs#158 from ava-labs/fix/advanced_import
handle P and C chain simultaneously
2 parents c2677ec + 11edd23 commit 6bab615

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/components/wallet/advanced/ChainImport.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<p>{{ $t('advanced.import.desc') }}</p>
55
<div v-if="isSuccess" class="is_success">
66
<label>Tx ID</label>
7-
<p>{{ txId }}</p>
7+
<p style="word-break: break-all; font-size: 13px">{{ txId }}</p>
88
</div>
99
<p class="err" v-else-if="err">{{ err }}</p>
1010
<template v-if="!isLoading">
@@ -57,14 +57,25 @@ export default class ChainImport extends Vue {
5757
async atomicImportX() {
5858
this.beforeSubmit()
5959
if (!this.wallet) return
60+
61+
// Import from P
6062
try {
6163
let txId = await this.wallet.importToXChain('P')
64+
this.onSuccess(txId)
65+
} catch (e) {
66+
if (this.isSuccess) return
67+
this.onError(e)
68+
}
69+
70+
// Import from C
71+
try {
6272
// TODO: Change after ledger support
6373
if (this.wallet.type !== 'ledger') {
6474
let txId2 = await this.wallet.importToXChain('C')
75+
this.onSuccess(txId2)
6576
}
66-
this.onSuccess(txId)
6777
} catch (e) {
78+
if (this.isSuccess) return
6879
this.onError(e)
6980
}
7081
}

src/components/wallet/earn/ChainTransfer/ChainTransfer.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ export default class ChainTransfer extends Vue {
370370
// STEP 3
371371
async chainImport() {
372372
let wallet: AvaHdWallet = this.$store.state.activeWallet
373-
374373
let importTxId
375374
try {
376375
if (this.targetChain === 'P') {

0 commit comments

Comments
 (0)