Skip to content

Commit 0ec80a5

Browse files
committed
SignTransactionLedger: stop operation when not on this view anymore
1 parent 687a29a commit 0ec80a5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/views/SignTransactionLedger.vue

+4
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ export default class SignTransactionLedger extends Vue {
293293
balance: (senderContract || signer).balance,
294294
};
295295
296+
// If user left this view in the mean time, don't continue signing / sending the transaction
297+
if (this.isDestroyed) return;
298+
296299
const transactionInfo = {
297300
sender: (senderContract || signer).address,
298301
senderType: senderContract ? senderContract.type : Nimiq.Account.Type.BASIC,
@@ -321,6 +324,7 @@ export default class SignTransactionLedger extends Vue {
321324
validityStartHeight,
322325
}, signer.path, senderAccount.keyId);
323326
} catch (e) {
327+
if (this.isDestroyed) return; // user is not on this view anymore
324328
// If cancelled and not expired, handle the exception. Otherwise just keep the ledger ui / expiry error
325329
// message displayed.
326330
if (this.state !== SignTransactionLedger.State.EXPIRED

0 commit comments

Comments
 (0)