mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-03-06 17:30:20 +00:00
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
This commit is contained in:
parent
77c6543c5d
commit
1bfad17b9a
@ -25,6 +25,7 @@ export function showShareConversationModal(modal, topicId) {
|
|||||||
|
|
||||||
export function composeAiBotMessage(targetBot, composer) {
|
export function composeAiBotMessage(targetBot, composer) {
|
||||||
const currentUser = composer.currentUser;
|
const currentUser = composer.currentUser;
|
||||||
|
const draftKey = "new_private_message_ai_" + new Date().getTime();
|
||||||
|
|
||||||
let botUsername = currentUser.ai_enabled_chat_bots.find(
|
let botUsername = currentUser.ai_enabled_chat_bots.find(
|
||||||
(bot) => bot.model_name === targetBot
|
(bot) => bot.model_name === targetBot
|
||||||
@ -37,10 +38,9 @@ export function composeAiBotMessage(targetBot, composer) {
|
|||||||
recipients: botUsername,
|
recipients: botUsername,
|
||||||
topicTitle: i18n("discourse_ai.ai_bot.default_pm_prefix"),
|
topicTitle: i18n("discourse_ai.ai_bot.default_pm_prefix"),
|
||||||
archetypeId: "private_message",
|
archetypeId: "private_message",
|
||||||
draftKey: "private_message_ai",
|
draftKey,
|
||||||
hasGroups: false,
|
hasGroups: false,
|
||||||
warningsDisabled: true,
|
warningsDisabled: true,
|
||||||
skipDraftCheck: true,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user