Proceso de lectura y envio completo
This commit is contained in:
@@ -31,13 +31,9 @@ onMounted(async () => {
|
||||
|
||||
window.api.nfc.onTag((event) => {
|
||||
uid.value = event.uid;
|
||||
readCard();
|
||||
readerState.value = "success";
|
||||
|
||||
// Reset state after 3 seconds
|
||||
setTimeout(() => {
|
||||
readerState.value = "waiting";
|
||||
uid.value = null;
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
window.api.nfc.onRemoved(() => {
|
||||
@@ -45,7 +41,7 @@ onMounted(async () => {
|
||||
// Reset state after 3 seconds
|
||||
setTimeout(() => {
|
||||
readerState.value = "waiting";
|
||||
}, 3000);
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
window.api.nfc.onError((event) => {
|
||||
@@ -86,7 +82,13 @@ const readCard = async (): Promise<void> => {
|
||||
|
||||
|
||||
// TODO: De momento está hardcodeado porque no se puede leer la tarjeta
|
||||
const card_id = "019cdd39-fc08-7417-b16d-a78794a24c01";
|
||||
const card_id = uid.value;
|
||||
if (card_id == undefined) {
|
||||
// TODO: LOG
|
||||
console.error("Error leyendo el token de la tarjeta");
|
||||
return;
|
||||
}
|
||||
|
||||
const override = false;
|
||||
|
||||
const res = await loadLabel({
|
||||
|
||||
Reference in New Issue
Block a user