Skip to content

Commit

Permalink
only go back after send if it's a chat
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul committed Jun 11, 2024
1 parent 1379b4a commit f95e7e2
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit f95e7e2

Please sign in to comment.