fix(frontend): recover rectification and consultation retries
This commit is contained in:
@@ -597,6 +597,7 @@ button:disabled { cursor: default; opacity: .45; }
|
||||
.product-entrypoint-footer small { min-width: 0; flex: 1; }
|
||||
.product-entrypoint-action { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: var(--space-1); color: var(--color-action); font-size: var(--type-caption); font-weight: 600; white-space: nowrap; }
|
||||
.product-entrypoint-action .starter-arrow { width: 15px; height: 15px; color: currentColor; }
|
||||
.rectification-entry-error { grid-column: 1 / -1; margin: 0; }
|
||||
.starter-loading { color: var(--color-ink-secondary); margin-left: 0; padding: var(--space-5); border-radius: var(--radius-lg); background: var(--color-canvas-muted); font-size: 14px; }
|
||||
.starter-note { margin: 10px 0 0; color: var(--color-ink-secondary); line-height: 1.5; grid-column: 1 / -1; font-size: 13px; }
|
||||
.message-list { margin: 0 auto; width: min(900px, 100%); padding: var(--space-8) var(--space-8) var(--space-16); }
|
||||
|
||||
@@ -1118,6 +1118,9 @@ export default function Home() {
|
||||
},
|
||||
);
|
||||
const rectificationCardLabel = rectificationEntryLabels[rectificationCardAction];
|
||||
const rectificationErrorMessage = rectificationError === "profile_incomplete"
|
||||
? "服务端未能读取完整出生资料,请重新确认并保存后再开始生时校正。"
|
||||
: rectificationError;
|
||||
const onboardingFingerprint = onboardingProfileFingerprint(profile);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -2411,14 +2414,10 @@ export default function Home() {
|
||||
const payload = await response.json().catch(() => null);
|
||||
if (!response.ok) {
|
||||
const code = payload?.code;
|
||||
if (code === "profile_incomplete" || code === "invalid_open_request") {
|
||||
const step = missingProfileStep(profile);
|
||||
if (step) {
|
||||
setRectificationSessionId(null);
|
||||
setRectificationCaseId(null);
|
||||
setOnboardingStep(step);
|
||||
setComposerNotice("请先完成出生资料,再开始生时校正。");
|
||||
}
|
||||
if (code === "profile_incomplete") {
|
||||
handleRectificationProfileIncomplete();
|
||||
} else if (code === "invalid_open_request") {
|
||||
setRectificationError(payload?.error || "生时校正打开请求不正确,请刷新后重试。");
|
||||
} else if (code === "active_case_conflict") {
|
||||
setRectificationError(payload?.error || "仍有未完成的校正,请先回到当前校正。");
|
||||
} else if (code === "case_session_not_found") {
|
||||
@@ -2466,7 +2465,7 @@ export default function Home() {
|
||||
void refreshRectificationEntrySummary();
|
||||
return opened;
|
||||
} catch {
|
||||
setComposerNotice("生时校正会话暂时无法打开,请稍后重试。");
|
||||
setRectificationError("生时校正会话暂时无法打开,请稍后重试。");
|
||||
return null;
|
||||
} finally {
|
||||
rectificationOpenInFlight.current = false;
|
||||
@@ -3391,6 +3390,11 @@ export default function Home() {
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
{rectificationError && !rectificationSurfaceOpen && (
|
||||
<p className="form-error rectification-entry-error" role="alert">
|
||||
{rectificationErrorMessage}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<section className="starter-themes" aria-labelledby="starter-themes-heading">
|
||||
<div className="starter-section-heading">
|
||||
|
||||
Reference in New Issue
Block a user