Skip to content

Commit

Permalink
Merge pull request #293 from cashubtc/nfc-errors-improve
Browse files Browse the repository at this point in the history
improve nfc errors
  • Loading branch information
callebtc authored Dec 24, 2024
2 parents 15bb11d + 769eabc commit 4953dd9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/SendTokenDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -825,34 +825,35 @@ export default defineComponent({
this.ndef
.write({ records: records }, { overwrite: true })
.then(() => {
console.log("Successfully flashed tokens to card!");
notifySuccess("Successfully flashed tokens to card!");
console.log("Successfully flashed token to card!");
notifySuccess("Successfully flashed token to card!");
this.showSendTokens = false;
})
.catch((err) => {
console.error(
`NFC write failed: The card may not have enough capacity (needed ${records[0].data.length} bytes).`
);
notifyError(
`NFC write failed: The card may not have enough capacity (needed ${records[0].data.length} bytes).`
`The card may not have enough capacity (needed ${records[0].data.length} bytes).`,
"NFC write failed"
);
});
} catch (err) {
console.error(`NFC error: ${err.message}`);
notifyError(`NFC error: ${err.message}`);
notifyError(`${err.message}`, "NFC error");
}
};
this.scanningCard = true;
})
.catch((error) => {
console.error(`NFC error: ${error.message}`);
notifyError(`NFC error: ${error.message}`);
notifyError(`${err.message}`, "NFC error");
this.scanningCard = false;
});
notifyWarning("This will overwrite your card!");
} catch (error) {
console.error(`NFC error: ${error.message}`);
notifyError(`NFC error: ${error.message}`);
notifyError(`${err.message}`, "NFC error");
this.scanningCard = false;
}
}
Expand Down

0 comments on commit 4953dd9

Please sign in to comment.