mirror of
https://github.com/temetro/temetro.git
synced 2026-08-27 19:06:52 +00:00
frontend: fix wallet push silently skipping in form dialogs
The "send to wallet" step in the appointment/invoice/prescription/ patient-edit/scribe dialogs was gated on sync.linked, which resolves asynchronously via getWalletLink in an effect. A fast save (or a transient failure that collapsed it to false) left a wallet-linked patient looking unlinked, so the dialog took the else branch and pushed nothing. - Add ensureLinked() to useWalletSync: awaits getWalletLink at submit and returns the resolved status. Each of the 5 dialogs now awaits it before deciding whether to show the wallet step. - Harden push() to drop empty/whitespace changes (the backend 400s on an empty change set) and add a translated summaryFallback so the step never sends an empty summary. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -396,7 +396,7 @@ export function PatientFormDialog({
|
||||
t("patientForm.updatedTitle"),
|
||||
t("patientForm.updatedBody", { name: saved.name }),
|
||||
);
|
||||
if (sync.linked) {
|
||||
if (await sync.ensureLinked()) {
|
||||
setStep("wallet");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user