From f6cdcada1ce5727296ca67bab090332872b337c9 Mon Sep 17 00:00:00 2001 From: Billy Lo Date: Fri, 1 Oct 2021 09:16:28 -0400 Subject: [PATCH] cleaned up console logging to be ready for main branch merge --- components/Form.tsx | 8 ++++---- components/Page.tsx | 2 +- pages/index.tsx | 3 ++- src/decode.ts | 4 ++-- src/passphoto-common.ts | 9 ++++++--- src/process.ts | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/components/Form.tsx b/components/Form.tsx index fca7507..efbe729 100644 --- a/components/Form.tsx +++ b/components/Form.tsx @@ -269,16 +269,16 @@ function Form(): JSX.Element { const passDose = selectedReceipt.numDoses; const covidPassFilename = `grassroots-receipt-${passName}-${vaxName}-${passDose}.pkpass`; - //console.log('> increment count'); + console.log('> increment count'); await incrementCount(); - // console.log('> generatePass'); + console.log('> generatePass'); const pass = await PassData.generatePass(payloadBody, selectedDose); - //console.log('> create blob'); + console.log('> create blob'); const passBlob = new Blob([pass], {type: "application/vnd.apple.pkpass"}); - //console.log(`> save blob as ${covidPassFilename}`); + console.log(`> save blob as ${covidPassFilename}`); saveAs(passBlob, covidPassFilename); setSaveLoading(false); } diff --git a/components/Page.tsx b/components/Page.tsx index c033328..b04f041 100644 --- a/components/Page.tsx +++ b/components/Page.tsx @@ -36,7 +36,7 @@ function Page(props: PageProps): JSX.Element { {t('common:gitHub')} {t('common:returnToMainSite')} -
Last updated: 2021-09-29 (v1.9.12)
+
Last updated: 2021-10-01 (v1.9.13)
diff --git a/pages/index.tsx b/pages/index.tsx index 03ccd21..f0484dd 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -74,10 +74,11 @@ function Index(): JSX.Element {

{t('common:subtitle')}


{t('common:subtitle2')}


{displayPassCount}

- Sept 29 afternoon update: + Oct 1 morning update:


diff --git a/src/decode.ts b/src/decode.ts index 8d3db84..563c736 100644 --- a/src/decode.ts +++ b/src/decode.ts @@ -33,7 +33,7 @@ export function decodedStringToReceipt(decoded: object) : HashTable { '207': 'MODERNA' } - console.log(decoded); + // console.log(decoded); const shcResources = decoded['vc'].credentialSubject.fhirBundle.entry; let issuer; if (decoded['iss'].includes('quebec.ca')) { @@ -98,7 +98,7 @@ export function decodedStringToReceipt(decoded: object) : HashTable { vaccinationDate = resource.occurrenceDateTime; const receipt = new Receipt(name, vaccinationDate, vaccineName, dateOfBirth, receiptNumber, organizationName); - console.log(receipt); + // console.log(receipt); receipts[receiptNumber] = receipt; } } diff --git a/src/passphoto-common.ts b/src/passphoto-common.ts index dd020dd..771369a 100644 --- a/src/passphoto-common.ts +++ b/src/passphoto-common.ts @@ -31,7 +31,10 @@ export interface PackageResult { export class PassPhotoCommon { static async preparePayload(payloadBody: PayloadBody, numDose: number) : Promise { - console.log(JSON.stringify(payloadBody, null, 2), numDose); + + console.log('preparePayload'); + + // console.log(JSON.stringify(payloadBody, null, 2), numDose); const payload: Payload = new Payload(payloadBody, numDose); @@ -60,7 +63,7 @@ export class PassPhotoCommon { body: JSON.stringify(clonedReceipt) // body data type must match "Content-Type" header } - console.log('registering ' + JSON.stringify(clonedReceipt, null, 2)); + // console.log('registering ' + JSON.stringify(clonedReceipt, null, 2)); const configResponse = await fetch('/api/config'); const configResponseJson = await configResponse.json(); @@ -78,7 +81,7 @@ export class PassPhotoCommon { const response = await fetch(registerUrl, requestOptions); const responseJson = await response.json(); - console.log(JSON.stringify(responseJson,null,2)); + // console.log(JSON.stringify(responseJson,null,2)); if (responseJson["result"] != 'OK') { console.error(responseJson); diff --git a/src/process.ts b/src/process.ts index 836339f..89f7f5f 100644 --- a/src/process.ts +++ b/src/process.ts @@ -25,7 +25,7 @@ export async function getPayloadBodyFromFile(file: File): Promise { switch (file.type) { case 'application/pdf': const receiptType = await detectReceiptType(fileBuffer); - console.log(receiptType); + console.log(`receiptType = ${receiptType}`); if (receiptType == 'ON') { receipts = await loadPDF(fileBuffer) // receipt type is needed to decide if digital signature checking is needed } else {