diff options
author | Grail Finder <wohilas@gmail.com> | 2024-11-21 07:25:23 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2024-11-21 07:25:23 +0300 |
commit | 35340d88863cb2a6a1b883bd3312abfef3a24c7a (patch) | |
tree | 31d41c25e97e7efec0849bdc3b8df2c0b521c90c /session.go | |
parent | 5ccad20bd680dc443b30f0decc8fca13427dc70d (diff) |
Fix: chat upsert
Diffstat (limited to 'session.go')
-rw-r--r-- | session.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -90,6 +90,12 @@ func loadOldChatOrGetNew() []models.MessagesStory { chatMap[newChat.Name] = newChat return defaultStarter } + if chat.Name == "" { + logger.Warn("empty chat name", "id", chat.ID) + chat.Name = fmt.Sprintf("%d_%v", chat.ID, chat.CreatedAt.Unix()) + } + chatMap[chat.Name] = chat + activeChatName = chat.Name return history } |