From 1bfad17b9a9f33e384ff7f45dd7be235a4a87ab3 Mon Sep 17 00:00:00 2001 From: David Battersby Date: Thu, 13 Feb 2025 05:08:31 +0400 Subject: [PATCH] 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 --- assets/javascripts/discourse/lib/ai-bot-helper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/lib/ai-bot-helper.js b/assets/javascripts/discourse/lib/ai-bot-helper.js index 7c8eb212..69832586 100644 --- a/assets/javascripts/discourse/lib/ai-bot-helper.js +++ b/assets/javascripts/discourse/lib/ai-bot-helper.js @@ -25,6 +25,7 @@ export function showShareConversationModal(modal, topicId) { export function composeAiBotMessage(targetBot, composer) { const currentUser = composer.currentUser; + const draftKey = "new_private_message_ai_" + new Date().getTime(); let botUsername = currentUser.ai_enabled_chat_bots.find( (bot) => bot.model_name === targetBot @@ -37,10 +38,9 @@ export function composeAiBotMessage(targetBot, composer) { recipients: botUsername, topicTitle: i18n("discourse_ai.ai_bot.default_pm_prefix"), archetypeId: "private_message", - draftKey: "private_message_ai", + draftKey, hasGroups: false, warningsDisabled: true, - skipDraftCheck: true, }, }); }