@@ -335,33 +335,19 @@ export default class Transfer extends mixins(
335
335
}
336
336
337
337
@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
350
343
}
351
344
352
345
@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
365
351
}
366
352
367
353
async loadBalance() {
0 commit comments