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

@@ -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("/");