diff --git a/Chat.go b/Chat.go index a23ac9c..272cb4d 100644 --- a/Chat.go +++ b/Chat.go @@ -15,13 +15,7 @@ import ( ) func ChatPageHandler(c *fiber.Ctx) error { - fmt.Println("Cookies: ", c.Cookies("jade-edgedb-auth-token")) - if c.Cookies("jade-edgedb-auth-token") == "" { - return c.Render("chat", fiber.Map{"IsLogin": false, "HaveKey": false, "IsSubscribed": false, "IsLimiteReached": false}, "layouts/main") - } else { - fmt.Println("Here") - return c.Render("chat", fiber.Map{"IsLogin": checkIfLogin(c), "HaveKey": checkIfHaveKey(c), "IsSubscribed": IsCurrentUserSubscribed(c), "IsLimiteReached": IsCurrentUserLimiteReached(c)}, "layouts/main") - } + return c.Render("chat", fiber.Map{}, "layouts/main") } func DeleteMessageHandler(c *fiber.Ctx) error { @@ -100,7 +94,6 @@ func generateChatHTML(c *fiber.Ctx) string { fmt.Println("Error getting current conversation") panic(err) } - fmt.Println("Current conversation: ", currentConv.Name) // Maybe redo that to be area by area because look like shit rn. It come from early stage of dev. It work tho soooo... var Messages []Message diff --git a/views/partials/popover-conversation.html b/views/partials/popover-conversation.html index 92816c3..f39dbc6 100644 --- a/views/partials/popover-conversation.html +++ b/views/partials/popover-conversation.html @@ -16,7 +16,7 @@ data-id="{{ Conversation.ID.String() }}" style="cursor: pointer;" onclick="toggleConversationSelection(this, '{{ Conversation.Name }}')" hx-get="/selectConversation?conversation-id={{ Conversation.ID.String() }}" hx-swap="outerHTML" - hx-target="#chat-container"> + hx-target="#chat-container" name="{{ Conversation.Name }}"> {{ Conversation.Name }} {% endfor %} @@ -159,10 +159,10 @@ document.getElementById('conversation-list').classList.remove('is-hidden'); // If the selected is the default conversation - if (document.getElementsByClassName('selected icon-conv')[0].getAttribute('data-id') === 'default') { + if (document.getElementsByClassName('selected icon-conv')[0].getAttribute('name') === 'Default') { document.getElementById('delete-conversation-button').classList.add('is-hidden'); document.getElementById('archive-default-conversation-button').classList.remove('is-hidden'); - document.getElementById('confirm-archive-default-conversation-button').classList.remove('is-hidden'); + document.getElementById('confirm-archive-default-conversation-button').classList.add('is-hidden'); } else { document.getElementById('delete-conversation-button').classList.remove('is-hidden'); document.getElementById('archive-default-conversation-button').classList.add('is-hidden');