From 2a7a4e700e0de588da97850c734d459870a95d44 Mon Sep 17 00:00:00 2001 From: Alessio Date: Thu, 9 May 2024 13:11:05 -0700 Subject: [PATCH] Remove 'dm-composer' OOB template and replace it with a simple 'hx-on:htmx:after-request' attribute --- internal/webserver/handler_messages.go | 1 - .../tpl/tweet_page_includes/chat_view.tpl | 20 ++----------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/internal/webserver/handler_messages.go b/internal/webserver/handler_messages.go index 07b7f26..1eb4922 100644 --- a/internal/webserver/handler_messages.go +++ b/internal/webserver/handler_messages.go @@ -51,7 +51,6 @@ func (app *Application) message_detail(w http.ResponseWriter, r *http.Request) { // First send a message, if applicable if is_sending { app.message_send(w, r) - app.buffered_render_htmx(w, "dm-composer", global_data, chat_view_data) // Wipe the chat box } // `LatestPollingTimestamp` sort of passes-through the function; if we're not updating it, it diff --git a/internal/webserver/tpl/tweet_page_includes/chat_view.tpl b/internal/webserver/tpl/tweet_page_includes/chat_view.tpl index b3f833a..7798502 100644 --- a/internal/webserver/tpl/tweet_page_includes/chat_view.tpl +++ b/internal/webserver/tpl/tweet_page_includes/chat_view.tpl @@ -147,8 +147,9 @@ hx-target="#new-messages-poller" hx-swap="outerHTML scroll:.chat-messages:bottom" hx-ext="json-enc" + hx-on:htmx:after-request="composer.innerText = ''; realInput.value = ''; " > - {{template "dm-composer"}} + @@ -246,23 +247,6 @@ {{end}} -{{define "dm-composer"}} - -{{end}} - {{define "conversation-top"}}
{{if .Cursor.CursorPosition.IsEnd}}