diff --git a/frontend/src/components/WorkspaceChat/index.jsx b/frontend/src/components/WorkspaceChat/index.jsx index bff7925730..90fafe5d03 100644 --- a/frontend/src/components/WorkspaceChat/index.jsx +++ b/frontend/src/components/WorkspaceChat/index.jsx @@ -96,7 +96,7 @@ function copyCodeSnippet(uuid) { } // Listens and hunts for all data-code-snippet clicks. -function setEventDelegatorForCodeSnippets() { +export function setEventDelegatorForCodeSnippets() { document?.addEventListener("click", function (e) { const target = e.target.closest("[data-code-snippet]"); const uuidCode = target?.dataset?.code; diff --git a/frontend/src/pages/Admin/Agents/Imported/ImportedSkillConfig/index.jsx b/frontend/src/pages/Admin/Agents/Imported/ImportedSkillConfig/index.jsx index 8d33e65631..0a98d8d257 100644 --- a/frontend/src/pages/Admin/Agents/Imported/ImportedSkillConfig/index.jsx +++ b/frontend/src/pages/Admin/Agents/Imported/ImportedSkillConfig/index.jsx @@ -55,6 +55,11 @@ export default function ImportedSkillConfig({ prev.map((s) => (s.hubId === config.hubId ? updatedConfig : s)) ); setConfig(updatedConfig); + showToast( + `Skill ${updatedConfig.active ? "activated" : "deactivated"}.`, + "success", + { clear: true } + ); } async function handleSubmit(e) { @@ -91,6 +96,7 @@ export default function ImportedSkillConfig({ ) ); showToast("Skill config updated successfully.", "success"); + setHasChanges(false); } useEffect(() => { diff --git a/frontend/src/pages/GeneralSettings/CommunityHub/ImportItem/Steps/PullAndReview/HubItem/AgentSkill.jsx b/frontend/src/pages/GeneralSettings/CommunityHub/ImportItem/Steps/PullAndReview/HubItem/AgentSkill.jsx index 2e8caacef7..85fec8b8a3 100644 --- a/frontend/src/pages/GeneralSettings/CommunityHub/ImportItem/Steps/PullAndReview/HubItem/AgentSkill.jsx +++ b/frontend/src/pages/GeneralSettings/CommunityHub/ImportItem/Steps/PullAndReview/HubItem/AgentSkill.jsx @@ -12,6 +12,7 @@ import { useEffect, useState } from "react"; import renderMarkdown from "@/utils/chat/markdown"; import DOMPurify from "dompurify"; import CommunityHub from "@/models/communityHub"; +import { setEventDelegatorForCodeSnippets } from "@/components/WorkspaceChat"; export default function AgentSkill({ item, settings, setStep }) { const [loading, setLoading] = useState(false); @@ -30,6 +31,10 @@ export default function AgentSkill({ item, settings, setStep }) { } } + useEffect(() => { + setEventDelegatorForCodeSnippets(); + }, []); + return (