From ca47e1de448e49b266bf3e3ac7fd56e3773eb832 Mon Sep 17 00:00:00 2001 From: Billy Lo Date: Sun, 24 Oct 2021 21:38:21 -0400 Subject: [PATCH] commented out fastlink feature for now on main branch so we can continue to deploy with worrying about traffic management --- components/Form.tsx | 30 ++++-------------------------- src/payload.ts | 12 +++++++----- 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/components/Form.tsx b/components/Form.tsx index e80f34a..ddf31d0 100644 --- a/components/Form.tsx +++ b/components/Form.tsx @@ -126,7 +126,10 @@ function Form(): JSX.Element { _setFileErrorMessages([]); checkBrowserType(); const payloadBody = await getPayload(selectedFile); - await createDataUrlForDisplay(selectedFile); + + //TODO: feature flagging + + // await createDataUrlForDisplay(selectedFile); await renderPhoto(payloadBody); } }); @@ -143,32 +146,7 @@ function Form(): JSX.Element { const buffer = Buffer.from(await new Response(file).arrayBuffer()); let dataUrl = `data:${file.type};base64,${buffer.toString("base64")}`; localStorage.setItem('pdfDataUrl', dataUrl); - // dataUrl = 'https://apple.com'; - - - // let script = `function debugBase64(base64URL){ - // var win = window.open(); - // win.document.write(''); - // } - // debugBase64('${dataUrl}'); - // `; - - // let hrefValue = `javascript:${script};` - - // let aElement = document.createElement('a') - // let textNode = document.createTextNode('Click me'); - // aElement.appendChild(textNode); - // aElement.title = 'Click me'; - // aElement.setAttribute('id', 'mylink'); - // aElement.setAttribute('href', hrefValue) - // // aElement.setAttribute('download', file.name) - // // aElement.setAttribute('target', '_blank') - - // document.getElementById('wrapper').appendChild(aElement); - - // console.log('*** outerHTML ***'); - // console.log(document.getElementById('wrapper').outerHTML) } } diff --git a/src/payload.ts b/src/payload.ts index f1b4e37..00104b5 100644 --- a/src/payload.ts +++ b/src/payload.ts @@ -89,11 +89,13 @@ export class Payload { console.log('*** attributedValue ***'); console.log(attributedValue); - this.generic.backFields.push({ - key: "original", - label: "Original receipt (saved locally in Safari)", - attributedValue: attributedValue - }); + //TODO: feature flagging + + // this.generic.backFields.push({ + // key: "original", + // label: "Original receipt (saved locally in Safari)", + // attributedValue: attributedValue + // }); } } }