only go back after send if it's a chat

This commit is contained in:
Paul Miller
2024-06-11 13:29:50 -05:00
parent 3bcb3f6d60
commit 5bcfb550ca
2 changed files with 7 additions and 5 deletions

View File

@@ -111,12 +111,9 @@ test("rountrip receive and send", async ({ page }) => {
// Wait for an h1 to appear in the dom that says "Payment Sent"
await page.waitForSelector("text=Payment Sent", { timeout: 30000 });
// Click the "Nice" button
// Click the "Nice" button to go home
await page.click("text=Nice");
// Go home
await page.click("text=Home");
// Click settings
await visitSettings(page);

View File

@@ -708,7 +708,12 @@ export function Send() {
onConfirm={() => {
setSentDetails(undefined);
const state = location.state as { previous?: string };
if (state?.previous) {
// If we're coming from a chat, we want to go back to the chat
// Otherwise we want to go home
if (
state?.previous &&
state?.previous.includes("chat/")
) {
navigate(state?.previous);
} else {
navigate("/");