|
70 | 70 | <a href="javascript:void(0)" @click="newFeePrice = feeSelectorFees.average.fee">Average: {{ feeSelectorFees.average.fee }}</a> |
71 | 71 | <a href="javascript:void(0)" @click="newFeePrice = feeSelectorFees.fast.fee">Fast: {{ feeSelectorFees.fast.fee }}</a> |
72 | 72 | </div> |
73 | | - <button class="btn btn-sm btn-outline-primary" @click="closeFeeSelector()">Cancel</button> |
74 | | - <button class="btn btn-sm btn-primary" @click="updateFee(step.tx.asset, step.tx.hash)">Update</button> |
| 73 | + <div> |
| 74 | + <button class="btn btn-sm btn-outline-primary" @click="closeFeeSelector()">Cancel</button> |
| 75 | + <button class="btn btn-sm btn-primary btn-icon" :disabled="feeSelectorLoading" @click="updateFee(step.tx.asset, step.tx.hash)"> |
| 76 | + <SpinnerIcon class="btn-loading" v-if="feeSelectorLoading" /> |
| 77 | + <template v-else>Update</template> |
| 78 | + </button> |
| 79 | + </div> |
75 | 80 | </div> |
76 | 81 | <a v-else href="javascript:void(0)" @click="openFeeSelector(step)">Speed up</a> |
77 | 82 | </template> |
@@ -266,6 +271,7 @@ export default { |
266 | 271 | secretHidden: true, |
267 | 272 | timeline: [], |
268 | 273 | showFeeSelector: false, |
| 274 | + feeSelectorLoading: false, |
269 | 275 | feeSelectorAsset: null, |
270 | 276 | newFeePrice: null |
271 | 277 | } |
@@ -329,7 +335,7 @@ export default { |
329 | 335 | return step.side === 'left' && (!step.tx.confirmations || step.tx.confirmations === 0) |
330 | 336 | }, |
331 | 337 | feeSelectorEnabled (step) { |
332 | | - return this.feeSelectorAsset === step.tx.asset && this.showFeeSelector |
| 338 | + return this.canUpdateFee(step) && this.feeSelectorAsset === step.tx.asset && this.showFeeSelector |
333 | 339 | }, |
334 | 340 | openFeeSelector (step) { |
335 | 341 | this.showFeeSelector = true |
@@ -393,15 +399,20 @@ export default { |
393 | 399 | this.timeline = timeline |
394 | 400 | }, |
395 | 401 | async updateFee (asset, hash) { |
396 | | - await this.updateTransactionFee({ |
397 | | - network: this.activeNetwork, |
398 | | - walletId: this.activeWalletId, |
399 | | - asset, |
400 | | - id: this.item.id, |
401 | | - hash, |
402 | | - newFee: this.newFeePrice |
403 | | - }) |
404 | | - this.showFeeSelector = false |
| 402 | + this.feeSelectorLoading = true |
| 403 | + try { |
| 404 | + await this.updateTransactionFee({ |
| 405 | + network: this.activeNetwork, |
| 406 | + walletId: this.activeWalletId, |
| 407 | + asset, |
| 408 | + id: this.item.id, |
| 409 | + hash, |
| 410 | + newFee: this.newFeePrice |
| 411 | + }) |
| 412 | + } finally { |
| 413 | + this.feeSelectorLoading = false |
| 414 | + this.showFeeSelector = false |
| 415 | + } |
405 | 416 | } |
406 | 417 | }, |
407 | 418 | created () { |
@@ -577,6 +588,7 @@ export default { |
577 | 588 |
|
578 | 589 | .btn-primary { |
579 | 590 | margin-left: 10px; |
| 591 | + min-width: 60px; |
580 | 592 | } |
581 | 593 |
|
582 | 594 | &_fees { |
|
0 commit comments