Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

fix: send transfer transaction to current peer #922

Merged
merged 2 commits into from Jan 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/renderer/components/Transaction/TransactionModal.vue
Expand Up @@ -16,7 +16,7 @@
<TransactionConfirm
v-if="transaction"
:transaction="transaction"
:wallet="alternativeWallet"
:wallet="walletOverride"
@back="onBack"
@confirm="onConfirm"
/>
Expand Down Expand Up @@ -62,7 +62,7 @@ export default {
data: () => ({
step: 0,
transaction: null,
alternativeWallet: null
walletOverride: null
}),

computed: {
Expand All @@ -85,11 +85,11 @@ export default {
},
walletNetwork () {
const sessionNetwork = this.session_network
if (!this.alternativeWallet || !this.alternativeWallet.id) {
if (!this.walletOverride || !this.walletOverride.id) {
return sessionNetwork
}

const profile = this.$store.getters['profile/byId'](this.alternativeWallet.profileId)
const profile = this.$store.getters['profile/byId'](this.walletOverride.profileId)

if (!profile.id) {
return sessionNetwork
Expand All @@ -103,7 +103,7 @@ export default {
onBuilt ({ transaction, wallet }) {
this.step = 1
this.transaction = transaction
this.alternativeWallet = wallet
this.walletOverride = wallet
},

onBack () {
Expand All @@ -126,7 +126,7 @@ export default {

let response
try {
if (this.alternativeWallet) {
if (this.walletOverride && this.session_network.id !== this.walletNetwork.id) {
const peer = await this.$store.dispatch('peer/findBest', {
refresh: true,
network: this.walletNetwork
Expand Down Expand Up @@ -210,7 +210,7 @@ export default {
vendorField,
confirmations: 0,
recipient: transaction.recipientId || transaction.sender,
profileId: this.alternativeWallet ? this.alternativeWallet.profileId : this.session_profile.id,
profileId: this.walletOverride ? this.walletOverride.profileId : this.session_profile.id,
raw: transaction
})
}
Expand Down