CSR-514 Add async/await to runExperimentsForTrigger

This commit is contained in:
Katie 2022-08-15 10:23:13 -04:00
parent 1216b121a8
commit 080d2ac28e

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