This commit is contained in:
Adrien Bouvais 2024-05-13 20:22:56 +02:00
parent c63813aff4
commit 2a57136c33
4 changed files with 18 additions and 1 deletions

17
Chat.go
View File

@ -174,6 +174,23 @@ func GetMessageContentHandler(c *fiber.Ctx) error {
out += " </ct>" out += " </ct>"
out += "</div>" out += "</div>"
// Update the selected value of messages in the database
err = edgeClient.Execute(edgeCtx, `
WITH m := (SELECT Message FILTER .id = <uuid>$0)
UPDATE Message
FILTER .area = m.area
SET {selected := false};
`, messageUUID)
if err != nil {
log.Fatal(err)
}
_ = edgeClient.Execute(edgeCtx, `
UPDATE Message
FILTER .id = <uuid>$0
SET {selected := true};
`, messageUUID)
return c.SendString(out) return c.SendString(out)
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

View File

@ -47,7 +47,7 @@
{% for message in Messages %} {% for message in Messages %}
<button class="button is-small is-primary message-button is-outlined mr-1" <button class="button is-small is-primary message-button is-outlined mr-1"
hx-get="/messageContent?id={{ message.Id }}" hx-target="#content-{{ ConversationAreaId }}" hx-get="/messageContent?id={{ message.Id }}" hx-target="#content-{{ ConversationAreaId }}"
onclick="updateIcon('{{ message.Icon }}', '{{ ConversationAreaId }}')"> onclick="updateIcon('{{ message.Icon }}', '{{ ConversationAreaId }}')" title="{{ message.Name }}">
<span class="icon is-small"> <span class="icon is-small">
<img src="icons/{{ message.Icon }}.png" alt="{{ message.Name }}" <img src="icons/{{ message.Icon }}.png" alt="{{ message.Name }}"
style="max-height: 100%; max-width: 100%;"> style="max-height: 100%; max-width: 100%;">