fix
This commit is contained in:
parent
fceaaef732
commit
3a98202a1c
9
Chat.go
9
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
|
||||
|
@ -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 }}">
|
||||
<span>{{ Conversation.Name }}</span>
|
||||
</div>
|
||||
{% 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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user