Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only go back after send if it's a chat #1209

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions e2e/roundtrip.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
7 changes: 6 additions & 1 deletion src/routes/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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("/");
Expand Down
Loading