diff options
author | Grail Finder <wohilas@gmail.com> | 2024-11-20 20:47:49 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2024-11-20 20:47:49 +0300 |
commit | 5ccad20bd680dc443b30f0decc8fca13427dc70d (patch) | |
tree | 5ed20ce680c09609a29f880cf41c976301f3e031 /session.go | |
parent | fc517c2c69d96501f1adc5a021b39b9eff22e4d7 (diff) |
Feat: add memory [wip]
Diffstat (limited to 'session.go')
-rw-r--r-- | session.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -69,14 +69,14 @@ func loadHistoryChat(chatName string) ([]models.MessagesStory, error) { } func loadOldChatOrGetNew() []models.MessagesStory { - // find last chat - chat, err := store.GetLastChat() newChat := &models.Chat{ ID: 0, CreatedAt: time.Now(), UpdatedAt: time.Now(), } - newChat.Name = fmt.Sprintf("%d_%v", chat.ID, chat.CreatedAt.Unix()) + newChat.Name = fmt.Sprintf("%d_%v", newChat.ID, newChat.CreatedAt.Unix()) + // find last chat + chat, err := store.GetLastChat() if err != nil { logger.Warn("failed to load history chat", "error", err) activeChatName = newChat.Name |