diff --git a/frontend/src/components/Messages.tsx b/frontend/src/components/Messages.tsx index 0e514be..1ebdc06 100644 --- a/frontend/src/components/Messages.tsx +++ b/frontend/src/components/Messages.tsx @@ -22,7 +22,9 @@ export default function Messages({ meId }: { meId: number }) { // the module (open() pushes an entry; back() = history.back()). const { view, open, back } = useHistorySubview("list"); - if (typeof view === "object") { + // Guard against a stale sub-view whose partnerId is the current user's own id (you can't + // message yourself). This can be inherited across an account switch — fall back to the list. + if (typeof view === "object" && view.partnerId !== meId) { return (