delay postMessage to ensure listener registered

This commit is contained in:
Barry Gitarts 2018-08-10 21:20:25 -04:00
parent 083bafcd6f
commit f30c403bb1
1 changed files with 4 additions and 1 deletions

View File

@ -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
)
}