From e5b5b9435b271fa1ea27db9c5b2fbd64a4b23976 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Mon, 25 Sep 2023 18:13:13 -0700 Subject: [PATCH] Fix compose page when replying to messages --- pkg/controller/inbox/compose.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/controller/inbox/compose.go b/pkg/controller/inbox/compose.go index 490047b..94e6ce4 100644 --- a/pkg/controller/inbox/compose.go +++ b/pkg/controller/inbox/compose.go @@ -41,12 +41,6 @@ func Compose() http.HandlerFunc { return } - // If we already have a thread open with them, go to that instead of the stand-alone compose page. - if msgID, ok := models.HasMessageThread(currentUser, user); ok { - templates.Redirect(w, fmt.Sprintf("/messages/read/%d", msgID)) - return - } - // POSTing? if r.Method == http.MethodPost { var ( @@ -75,6 +69,12 @@ func Compose() http.HandlerFunc { return } + // If we already have a thread open with them, go to that instead of the stand-alone compose page. + if msgID, ok := models.HasMessageThread(currentUser, user); ok { + templates.Redirect(w, fmt.Sprintf("/messages/read/%d", msgID)) + return + } + // On GET request (come from a user profile page): // Do not allow a shy user to initiate DMs with a non-shy one. var (