diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/index.jsx
index ec42050a28c..e7e5536ea2a 100644
--- a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/index.jsx
+++ b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/index.jsx
@@ -100,7 +100,7 @@ export default function SlashPresets({ setShowing, sendCommand }) {
e.stopPropagation();
handleEditPreset(preset);
}}
- className="text-theme-text-primary text-sm p-1 hover:cursor-pointer hover:bg-theme-action-menu-item-hover rounded-full mt-1"
+ className="border-none text-theme-text-primary text-sm p-1 hover:cursor-pointer hover:bg-theme-action-menu-item-hover rounded-full mt-1"
>
+ You haven't created any items yet. +
+ )} @@ -66,7 +75,7 @@ export default function UserItems({ connectionKey }) { {team.teamName} {Object.keys(team.items).map((type) => { - if (team.items[type].items.length === 0) return null; + if (!team.items[type]?.items?.length) return null; return (+ No items shared with this team yet. +
+ )} ))} diff --git a/frontend/src/pages/GeneralSettings/CommunityHub/Authentication/index.jsx b/frontend/src/pages/GeneralSettings/CommunityHub/Authentication/index.jsx index 98f4450c35c..7cf0d1c7603 100644 --- a/frontend/src/pages/GeneralSettings/CommunityHub/Authentication/index.jsx +++ b/frontend/src/pages/GeneralSettings/CommunityHub/Authentication/index.jsx @@ -46,6 +46,26 @@ function useCommunityHubAuthentication() { } } + async function disconnectHub() { + setLoading(true); + try { + const response = await CommunityHub.updateSettings({ + hub_api_key: "", + }); + if (!response.success) + return showToast("Failed to disconnect from hub", "error"); + setHasChanges(false); + showToast("Disconnected from AnythingLLM Community Hub", "success"); + setOriginalConnectionKey(""); + setConnectionKey(""); + } catch (error) { + console.error(error); + showToast("Failed to disconnect from hub", "error"); + } finally { + setLoading(false); + } + } + useEffect(() => { const fetchData = async () => { setLoading(true); @@ -70,6 +90,7 @@ function useCommunityHubAuthentication() { updateConnectionKey, hasChanges, resetChanges, + disconnectHub, }; } @@ -82,6 +103,7 @@ export default function CommunityHubAuthentication() { updateConnectionKey, hasChanges, resetChanges, + disconnectHub, } = useCommunityHubAuthentication(); if (loading) return- You can get your API key from your{" "} - - AnythingLLM Community Hub profile page - - . -
++ You can get your API key from your{" "} + + AnythingLLM Community Hub profile page + + . +
+ {!!originalConnectionKey && ( + + )} +