Merge pull request #657 from Safelite/feature/CSR-514

CSR-514 Add async/await to runExperimentsForTrigger
This commit is contained in:
katieoh-safelite 2022-08-15 10:41:22 -04:00 committed by GitHub
commit 5771256089
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,7 +62,7 @@ const routes = [
to.query.fmgPage = pageToRedirectTo;
}
runExperiments(to.query.fmgPage);
await runExperiments(to.query.fmgPage);
// Process funnel cookie.
updateOrCreateFunnelCookie();
@ -269,16 +269,16 @@ function arePagePrerequisitesValid(component) {
}
// Run SiteEntry and PageEntry triggers for experiments
function runExperiments(nextPage) {
async function runExperiments(nextPage) {
if (!store.getters.applicationUser.triggeredSiteEntry) {
baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, {
await baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, {
userId: getDeviceIdValue(),
triggerEvent: experimentTriggers.SITE_ENTRY,
triggerValue: applicationConfig.SITE_ENTRY_TRIGGER_VALUE
})
}
baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, {
await baseMixin.methods.dispatchStoreAction(storeActions.RUN_EXPERIMENTS_FOR_TRIGGER, {
userId: getDeviceIdValue(),
triggerEvent: experimentTriggers.PAGE_ENTRY,
triggerValue: nextPage