Skip to content

Commit

Permalink
update to use the new initialize structure, return false when not a v…
Browse files Browse the repository at this point in the history
…alid category, move skip check to a better place in code
  • Loading branch information
arunshenoy99 committed May 26, 2023
1 parent 0d9b79c commit d32de03
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion includes/Services/EventService.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function validate( $event ) {
}

if ( ! isset( $event['category'] ) || ! self::validate_category( $event['category'] ) ) {
$event['category'] = Events::get_category();
return false;
}

return $event;
Expand Down
2 changes: 1 addition & 1 deletion src/OnboardingSPA/components/SkipButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ const SkipButton = ( { callback = false } ) => {
if ( socialDataResp ) {
setOnboardingSocialData( socialDataResp );
}
await HiiveAnalytics.dispatchEvents();
}
setFlow( currentData );
}
await HiiveAnalytics.dispatchEvents();
// Redirect to Admin Page for normal customers
// and Bluehost Dashboard for ecommerce customers
const exitLink = exitToWordpressForEcommerce()
Expand Down
12 changes: 9 additions & 3 deletions src/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ import { onboardingRestURL } from './OnboardingSPA/utils/api/common';
if ( runtimeDataExists ) {
domReady( () => {
HiiveAnalytics.initialize( {
defaultUrl: onboardingRestURL( 'events' ),
batchUrl: onboardingRestURL( 'events/batch' ),
debounceTime: 3000,
urls: {
single: onboardingRestURL( 'events' ),
batch: onboardingRestURL( 'events/batch' ),
},
settings: {
debounce: {
time: 3000,
},
},
} );

initializeNFDOnboarding(
Expand Down

0 comments on commit d32de03

Please sign in to comment.