From 1f57403cd7ae36c7f85ed3c034e2fa6bb4d1d255 Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Mon, 4 Oct 2021 20:23:43 -0400 Subject: [PATCH] name fix for photo receipts --- src/photo.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/photo.ts b/src/photo.ts index 259eb1e..0ae97d8 100644 --- a/src/photo.ts +++ b/src/photo.ts @@ -40,8 +40,19 @@ export class Photo { body.hidden = false; body.style.backgroundColor = payload.backgroundColor - const vaccineName = receipt.vaccineName; - let doseVaccine = "#" + String(receipt.numDoses) + ": " + vaccineName; + const vaccineName = receipt.vaccineName.toLocaleUpperCase(); + let vaccineNameProper = vaccineName.charAt(0) + vaccineName.substr(1).toLowerCase(); + + if (vaccineName.includes('PFIZER')) + vaccineNameProper = 'Pfizer (Comirnaty)' + + if (vaccineName.includes('MODERNA')) + vaccineNameProper = 'Moderna (SpikeVax)' + + if (vaccineName.includes('ASTRAZENECA') || vaccineName.includes('COVISHIELD')) + vaccineNameProper = 'AstraZeneca (Vaxzevria)' + + let doseVaccine = "#" + String(receipt.numDoses) + ": " + vaccineNameProper; document.getElementById('vaccineName').innerText = doseVaccine;