hide incomplete sources for non-admins (#1901)

This commit is contained in:
pablodanswer 2024-07-22 13:40:11 -07:00 committed by GitHub
parent 6c88c0156c
commit 4029233df0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -168,7 +168,8 @@ export default async function Home() {
(ccPair) => ccPair.has_successful_run && ccPair.docs_indexed > 0
) &&
!shouldDisplayNoSourcesModal &&
!shouldShowWelcomeModal;
!shouldShowWelcomeModal &&
(!user || user.role == "admin");
const sidebarToggled = cookies().get(SIDEBAR_TOGGLED_COOKIE_NAME);
const agenticSearchToggle = cookies().get(AGENTIC_SEARCH_TYPE_COOKIE_NAME);

View File

@ -177,7 +177,8 @@ export async function fetchChatData(searchParams: {
!shouldShowWelcomeModal &&
!ccPairs.some(
(ccPair) => ccPair.has_successful_run && ccPair.docs_indexed > 0
);
) &&
(!user || user.role == "admin");
// if no connectors are setup, only show personas that are pure
// passthrough and don't do any retrieval