Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 1bfad17

Browse files
authored
FIX: update draft key for new PM with AI bot (#1123)
* FIX: update draft key for new PM with AI bot * allow multiple drafts with ai bot * fix linting
1 parent 77c6543 commit 1bfad17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

assets/javascripts/discourse/lib/ai-bot-helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export function showShareConversationModal(modal, topicId) {
2525

2626
export function composeAiBotMessage(targetBot, composer) {
2727
const currentUser = composer.currentUser;
28+
const draftKey = "new_private_message_ai_" + new Date().getTime();
2829

2930
let botUsername = currentUser.ai_enabled_chat_bots.find(
3031
(bot) => bot.model_name === targetBot
@@ -37,10 +38,9 @@ export function composeAiBotMessage(targetBot, composer) {
3738
recipients: botUsername,
3839
topicTitle: i18n("discourse_ai.ai_bot.default_pm_prefix"),
3940
archetypeId: "private_message",
40-
draftKey: "private_message_ai",
41+
draftKey,
4142
hasGroups: false,
4243
warningsDisabled: true,
43-
skipDraftCheck: true,
4444
},
4545
});
4646
}

0 commit comments

Comments
 (0)