Skip to content
Snippets Groups Projects
Verified Commit 65caa62d authored by magicfelix's avatar magicfelix Committed by Tom Teichler
Browse files

Fix JavaScript syntax

parent 129b8277
No related branches found
No related tags found
1 merge request!48Revert "Update pyproject"
......@@ -24,7 +24,7 @@
export default {
data () {
return {
comment: "",
comment: ""
}
},
......@@ -51,30 +51,33 @@
},
startScan() {
try {
const ndef = NDEFReader();
ndef.scan().then(() => {
ndef.addEventListener("readingerror", () => {
const ndef = new NDEFReader();
ndef.scan().then(() => {
ndef.addEventListener("readingerror", () => {
});
ndef.addEventListener("reading", (message, uid) {
for (const record of message.records) {
if (record.recordType !== "url") {
continue;
}
const decoder = new TextDecoder();
const url = decoder.decode(record.data);
// FIXME use configured base URL here
if (!url.startsWith("https://ticdesk.teckids.org/o/")) {
continue;
}
fetch(url).then((res => res.json()).then((data) => {
this.checkIn(data.id);
});
});
ndef.addEventListener("reading", (e) => {
const message = e.message;
for (const record of message.records) {
if (record.recordType !== "url") {
continue;
}
});
}
}
const decoder = new TextDecoder();
const url = decoder.decode(record.data);
// FIXME use configured base URL here
if (!url.startsWith("https://ticdesk.teckids.org/o/")) {
continue;
}
fetch(url).then((res) => res.json()).then((data) => {
this.checkIn(data.id);
});
}
});
});
} catch {
console.log("Error");
}
}
},
}
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment