mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-02-02 13:04:22 +01:00
only go back after send if it's a chat
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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("/");
|
||||
|
||||
Reference in New Issue
Block a user