Skip to content

Commit 672b25e

Browse files
authored
Merge pull request #1773 from atharva3010/#1769
#1769 FIX Warning on navigationDuplicated in Transfer
2 parents 0c92946 + 24ce6f6 commit 672b25e

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed

pages/transfer.vue

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -335,33 +335,19 @@ export default class Transfer extends mixins(
335335
}
336336
337337
@Watch('destinationAddress')
338-
destinationChanged(value: string): void {
339-
const queryValue: any = {}
340-
if (value) {
341-
queryValue.target = value
342-
}
343-
if (this.$route.query.usdamount) {
344-
queryValue.usdamount = this.$route.query.usdamount
345-
}
346-
this.$router.replace({
347-
path: String(this.$route.path),
348-
query: queryValue,
349-
}).catch((e)=>{console.warn('Navigation error', e)})
338+
destinationChanged(target: string): void {
339+
const { usdamount } = this.$route.query
340+
this.$router
341+
.replace({ query: { target, usdamount } })
342+
.catch(() => null) // null to further not throw navigation errors
350343
}
351344
352345
@Watch('usdValue')
353-
usdValueChanged(value: string): void {
354-
const queryValue: any = {}
355-
if (value) {
356-
queryValue.usdamount = value
357-
}
358-
if (this.$route.query.target) {
359-
queryValue.target = this.$route.query.target
360-
}
361-
this.$router.replace({
362-
path: String(this.$route.path),
363-
query: queryValue,
364-
}).catch((e)=>{console.warn('Navigation error', e)})
346+
usdValueChanged(usdamount: string): void {
347+
const { target } = this.$route.query
348+
this.$router
349+
.replace({ query: { target, usdamount } })
350+
.catch(() => null) // null to further not throw navigation errors
365351
}
366352
367353
async loadBalance() {

0 commit comments

Comments
 (0)