@product7/product7-js 0.4.7 → 0.4.9
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.
package/dist/product7-js.js
CHANGED
|
@@ -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
|
-
this._showThankYouScreen()
|
|
13348
|
+
this._showThankYouScreen(() => {
|
|
13349
|
+
if (this.surveyOptions.onSubmit) {
|
|
13350
|
+
this.surveyOptions.onSubmit(response);
|
|
13351
|
+
}
|
|
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.');
|
|
@@ -13599,7 +13599,7 @@
|
|
|
13599
13599
|
setTimeout(() => error.remove(), 3000);
|
|
13600
13600
|
}
|
|
13601
13601
|
|
|
13602
|
-
_showThankYouScreen() {
|
|
13602
|
+
_showThankYouScreen(onAfterClose) {
|
|
13603
13603
|
if (!this.surveyElement) return;
|
|
13604
13604
|
|
|
13605
13605
|
const config = this.surveyOptions.thankYouConfig || {};
|
|
@@ -13635,6 +13635,7 @@
|
|
|
13635
13635
|
setTimeout(
|
|
13636
13636
|
() => {
|
|
13637
13637
|
if (this.surveyElement) this._closeSurvey();
|
|
13638
|
+
if (onAfterClose) onAfterClose();
|
|
13638
13639
|
},
|
|
13639
13640
|
buttonText ? 6000 : 3500
|
|
13640
13641
|
);
|