@product7/product7-js 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13340,16 +13340,16 @@
13340
13340
  };
13341
13341
 
13342
13342
  try {
13343
- if (this.surveyOptions.onSubmit) {
13344
- this.surveyOptions.onSubmit(response);
13345
- }
13346
-
13347
13343
  const surveyId =
13348
13344
  this.surveyOptions.surveyId || `local_${type}_${Date.now()}`;
13349
13345
  await this.apiService.submitSurveyResponse(surveyId, responseData);
13350
13346
 
13351
13347
  this.sdk.eventBus.emit('survey:submitted', { widget: this, response });
13352
13348
  this._showThankYouScreen();
13349
+
13350
+ if (this.surveyOptions.onSubmit) {
13351
+ this.surveyOptions.onSubmit(response);
13352
+ }
13353
13353
  } catch (error) {
13354
13354
  console.error('[SurveyWidget] Failed to submit survey:', error);
13355
13355
  this._showError('Something went wrong. Please try again.');