@eric-emg/symphiq-components 1.2.397 → 1.2.399
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,25 @@ 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);
|
|
89079
89082
|
setTimeout(() => {
|
|
89080
89083
|
this.isSaving.set(false);
|
|
89081
|
-
if (
|
|
89084
|
+
if (actionToPerform === 'save') {
|
|
89082
89085
|
this.navigateToList.emit();
|
|
89083
89086
|
}
|
|
89084
|
-
else if (
|
|
89087
|
+
else if (actionToPerform === 'saveAndNext') {
|
|
89085
89088
|
this.navigateToNextQuestion.emit();
|
|
89086
89089
|
}
|
|
89087
|
-
this.pendingQuestionId.set(null);
|
|
89088
|
-
this.pendingSaveAction.set(null);
|
|
89089
89090
|
}, remainingDelay);
|
|
89090
89091
|
}
|
|
89091
89092
|
}
|
|
@@ -90607,22 +90608,8 @@ class ShopProfileQuestionsModalComponent {
|
|
|
90607
90608
|
const answers = this.profileAnswers();
|
|
90608
90609
|
const isAnswered = (q) => answers.some(a => a.profileQuestionId === q.id);
|
|
90609
90610
|
const currentIndex = questions.findIndex(q => q.id === currentQuestion.id);
|
|
90610
|
-
|
|
90611
|
-
|
|
90612
|
-
index: i,
|
|
90613
|
-
id: q.id,
|
|
90614
|
-
question: q.question?.substring(0, 50) + '...',
|
|
90615
|
-
isAnswered: isAnswered(q)
|
|
90616
|
-
})));
|
|
90617
|
-
console.log('[NextQuestion] currentQuestion:', { id: currentQuestion.id, question: currentQuestion.question?.substring(0, 50) });
|
|
90618
|
-
console.log('[NextQuestion] currentIndex:', currentIndex);
|
|
90619
|
-
const afterCurrent = questions.slice(currentIndex + 1);
|
|
90620
|
-
const beforeCurrent = questions.slice(0, currentIndex);
|
|
90621
|
-
console.log('[NextQuestion] searching afterCurrent (indices', currentIndex + 1, 'to', questions.length - 1, '):', afterCurrent.map(q => ({ id: q.id, isAnswered: isAnswered(q) })));
|
|
90622
|
-
console.log('[NextQuestion] searching beforeCurrent (indices 0 to', currentIndex - 1, '):', beforeCurrent.map(q => ({ id: q.id, isAnswered: isAnswered(q) })));
|
|
90623
|
-
const nextUnanswered = afterCurrent.find(q => !isAnswered(q))
|
|
90624
|
-
|| beforeCurrent.find(q => !isAnswered(q));
|
|
90625
|
-
console.log('[NextQuestion] nextUnanswered:', nextUnanswered ? { id: nextUnanswered.id, question: nextUnanswered.question?.substring(0, 50) } : 'none');
|
|
90611
|
+
const nextUnanswered = questions.slice(currentIndex + 1).find(q => !isAnswered(q))
|
|
90612
|
+
|| questions.slice(0, currentIndex).find(q => !isAnswered(q));
|
|
90626
90613
|
if (nextUnanswered) {
|
|
90627
90614
|
this.questionForAnswer.set(nextUnanswered);
|
|
90628
90615
|
if (nextUnanswered.id) {
|