Skip to content

Commit

Permalink
chore: add console logs for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
mantariksh committed Oct 14, 2024
1 parent 31c7eb5 commit d851233
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/features/public-form/PublicFormProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ export const PublicFormProvider = ({
[PAYMENT_PRODUCT_FIELD_ID]: paymentProducts,
...formInputs
}) => {
console.log('Called handleSubmitForm')
const { form } = data ?? {}
if (!form) return

Expand Down Expand Up @@ -674,6 +675,7 @@ export const PublicFormProvider = ({
}
}
case FormResponseMode.Encrypt: {
console.log('In handler for FormResponseMode.Encrypt')
// Using mutateAsync so react-hook-form goes into loading state.

const formPaymentData: {
Expand Down Expand Up @@ -719,6 +721,7 @@ export const PublicFormProvider = ({
// payment forms will have non-empty paymentData field
paymentData,
}) => {
console.log('In onSuccess for submitStorageModeFormFetchMutation')

Check failure on line 724 in frontend/src/features/public-form/PublicFormProvider.tsx

View workflow job for this annotation

GitHub Actions / frontend_lint

Replace `'In·onSuccess·for·submitStorageModeFormFetchMutation'` with `⏎······················'In·onSuccess·for·submitStorageModeFormFetchMutation',⏎····················`
trackSubmitForm(form)
postIFrameMessage({ state: 'submitted', submissionId })

Expand Down Expand Up @@ -785,6 +788,7 @@ export const PublicFormProvider = ({
// payment forms will have non-empty paymentData field
paymentData,
}) => {
console.log('In onSuccess for submitStorageModeFormMutation')
trackSubmitForm(form)
postIFrameMessage({ state: 'submitted', submissionId })
if (paymentData) {
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/features/public-form/utils/iframeMessaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ const TRUSTED_TARGET_ORIGINS = [
export const postIFrameMessage = (message: PublicFormIFrameMessage): void => {
// De-risk by wrapping in try-catch even though this is synchronous. This should
// never block form submission.
console.log('Posting iframe message', JSON.stringify(message))
try {
TRUSTED_TARGET_ORIGINS.forEach((origin) => {
console.log(`Posting iframe message to origin ${origin}`)
window.parent.postMessage(message, origin)
})
} catch (error) {
Expand Down

0 comments on commit d851233

Please sign in to comment.