mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-13 09:30:53 +02:00
ensure shared assistants accessible via query params (#2740)
This commit is contained in:
parent
2d74d44538
commit
b4417fabd7
@ -187,7 +187,6 @@ export function ChatPage({
|
|||||||
)
|
)
|
||||||
: undefined
|
: undefined
|
||||||
);
|
);
|
||||||
|
|
||||||
// Gather default temperature settings
|
// Gather default temperature settings
|
||||||
const search_param_temperature = searchParams.get(
|
const search_param_temperature = searchParams.get(
|
||||||
SEARCH_PARAM_NAMES.TEMPERATURE
|
SEARCH_PARAM_NAMES.TEMPERATURE
|
||||||
@ -694,11 +693,12 @@ export function ChatPage({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (messageHistory.length === 0 && chatSessionIdRef.current === null) {
|
if (messageHistory.length === 0 && chatSessionIdRef.current === null) {
|
||||||
|
// Select from available assistants so shared assistants appear.
|
||||||
setSelectedAssistant(
|
setSelectedAssistant(
|
||||||
finalAssistants.find((persona) => persona.id === defaultAssistantId)
|
availableAssistants.find((persona) => persona.id === defaultAssistantId)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [defaultAssistantId, finalAssistants, messageHistory.length]);
|
}, [defaultAssistantId, availableAssistants, messageHistory.length]);
|
||||||
|
|
||||||
const [
|
const [
|
||||||
selectedDocuments,
|
selectedDocuments,
|
||||||
|
@ -153,6 +153,7 @@ export async function fetchChatData(searchParams: {
|
|||||||
console.log(`Failed to fetch assistants - ${assistantsFetchError}`);
|
console.log(`Failed to fetch assistants - ${assistantsFetchError}`);
|
||||||
}
|
}
|
||||||
// remove those marked as hidden by an admin
|
// remove those marked as hidden by an admin
|
||||||
|
|
||||||
assistants = assistants.filter((assistant) => assistant.is_visible);
|
assistants = assistants.filter((assistant) => assistant.is_visible);
|
||||||
|
|
||||||
// sort them in priority order
|
// sort them in priority order
|
||||||
|
Loading…
x
Reference in New Issue
Block a user