From 9cef220f908bdb6dc0ea49cb015cd5111f69a063 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 8 Mar 2025 20:18:37 -0600 Subject: [PATCH] ui: Persist success notification, redirect to list Tabitha requested that the application returns to the transaction list after the form was submitted successfully. Before the navigation starts, we still want to see the info toast, though. Since the navigation may take a few seconds, we keep the toast open indefinitely. --- js/transaction.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/transaction.ts b/js/transaction.ts index 59f453c..4a31fc1 100644 --- a/js/transaction.ts +++ b/js/transaction.ts @@ -96,7 +96,13 @@ async function submitForm(data: FormData) { btnsubmit.loading = false; if (r) { if (r.ok) { - notify("Successfully updated transaction"); + notify( + "Successfully updated transaction", + undefined, + undefined, + null, + ); + window.location.href = "/transactions"; } else { const html = await r.text(); if (html) {