Skip to content

Commit e107d8b

Browse files
committed
Fix failure to resume failed swap 0
If for some reason the very first user of the swap was to refresh the page right after submitting his tx he wouldn’t be able to resume the swap as we were losing the swap secret from localstorage.
1 parent 6455de0 commit e107d8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/website/components/detect-swaps/detect-non-complete-swaps.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ export const DetectNonCompleteSwaps = () => {
6565
const log = getCommitLog(txReceipt)
6666

6767
if (log.name === 'Commit') {
68-
if (log.args.id) {
69-
setSwapSecrets(log.args.id, txSecrets[txHash])
68+
if (log.args && typeof log.args.id === 'number' && log.args.id >= 0) {
69+
setSwapSecrets(String(log.args.id), txSecrets[txHash])
7070
}
7171
}
7272

0 commit comments

Comments
 (0)