@eric-emg/symphiq-components 1.2.397 → 1.2.398
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.
|
@@ -89068,24 +89068,26 @@ class ShopProfileQuestionAnswerComponent {
|
|
|
89068
89068
|
});
|
|
89069
89069
|
effect(() => {
|
|
89070
89070
|
const answers = this.profileAnswers();
|
|
89071
|
-
const pendingId = this.pendingQuestionId();
|
|
89072
|
-
const pendingAction = this.pendingSaveAction();
|
|
89071
|
+
const pendingId = untracked(() => this.pendingQuestionId());
|
|
89072
|
+
const pendingAction = untracked(() => this.pendingSaveAction());
|
|
89073
89073
|
if (pendingId !== null && pendingAction !== null) {
|
|
89074
89074
|
const hasAnswerForQuestion = answers.some(a => a.profileQuestionId === pendingId);
|
|
89075
89075
|
if (hasAnswerForQuestion) {
|
|
89076
89076
|
const elapsed = Date.now() - this.saveStartTime();
|
|
89077
89077
|
const minDelay = 300;
|
|
89078
89078
|
const remainingDelay = Math.max(0, minDelay - elapsed);
|
|
89079
|
+
const actionToPerform = pendingAction;
|
|
89080
|
+
this.pendingQuestionId.set(null);
|
|
89081
|
+
this.pendingSaveAction.set(null);
|
|
89082
|
+
console.log('[AnswerEffect] Detected answer for', pendingId, 'action:', actionToPerform);
|
|
89079
89083
|
setTimeout(() => {
|
|
89080
89084
|
this.isSaving.set(false);
|
|
89081
|
-
if (
|
|
89085
|
+
if (actionToPerform === 'save') {
|
|
89082
89086
|
this.navigateToList.emit();
|
|
89083
89087
|
}
|
|
89084
|
-
else if (
|
|
89088
|
+
else if (actionToPerform === 'saveAndNext') {
|
|
89085
89089
|
this.navigateToNextQuestion.emit();
|
|
89086
89090
|
}
|
|
89087
|
-
this.pendingQuestionId.set(null);
|
|
89088
|
-
this.pendingSaveAction.set(null);
|
|
89089
89091
|
}, remainingDelay);
|
|
89090
89092
|
}
|
|
89091
89093
|
}
|