From f30c403bb17e47007951919ef55248570857d043 Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Fri, 10 Aug 2018 21:20:25 -0400 Subject: [PATCH] delay postMessage to ensure listener registered --- app/actions/accounts.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/actions/accounts.js b/app/actions/accounts.js index fbfdc4e..8ab8599 100644 --- a/app/actions/accounts.js +++ b/app/actions/accounts.js @@ -30,5 +30,8 @@ export const checkAndDispatchStatusContactCode = dispatch => { if (statusApiSuccess(event) && hasContactCode()) dispatch(receiveStatusContactCode(STATUS_API[CONTACT_CODE])) }); - window.postMessage({ type: STATUS_API_REQUEST, permissions: ["CONTACT_CODE", "CONTACTS"] }, '*'); + setTimeout( + () => { window.postMessage({ type: STATUS_API_REQUEST, permissions: ["CONTACT_CODE", "CONTACTS"] }, '*') }, + 1000 + ) }