Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit 5bcfb55

Browse files
committed
only go back after send if it's a chat
1 parent 3bcb3f6 commit 5bcfb55

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

e2e/roundtrip.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,9 @@ test("rountrip receive and send", async ({ page }) => {
111111
// Wait for an h1 to appear in the dom that says "Payment Sent"
112112
await page.waitForSelector("text=Payment Sent", { timeout: 30000 });
113113

114-
// Click the "Nice" button
114+
// Click the "Nice" button to go home
115115
await page.click("text=Nice");
116116

117-
// Go home
118-
await page.click("text=Home");
119-
120117
// Click settings
121118
await visitSettings(page);
122119

src/routes/Send.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,12 @@ export function Send() {
708708
onConfirm={() => {
709709
setSentDetails(undefined);
710710
const state = location.state as { previous?: string };
711-
if (state?.previous) {
711+
// If we're coming from a chat, we want to go back to the chat
712+
// Otherwise we want to go home
713+
if (
714+
state?.previous &&
715+
state?.previous.includes("chat/")
716+
) {
712717
navigate(state?.previous);
713718
} else {
714719
navigate("/");

0 commit comments

Comments
 (0)