mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-21 14:12:42 +02:00
Update default assistants to all visible (#2490)
* update default assistants to all visible * update with catch-all * minor update * update
This commit is contained in:
@@ -306,9 +306,11 @@ export function AssistantsList({
|
||||
user?.preferences?.chosen_assistants &&
|
||||
!user?.preferences?.chosen_assistants?.includes(assistant.id)
|
||||
);
|
||||
|
||||
const allAssistantIds = assistants.map((assistant) =>
|
||||
assistant.id.toString()
|
||||
);
|
||||
|
||||
const [deletingPersona, setDeletingPersona] = useState<Persona | null>(null);
|
||||
const [makePublicPersona, setMakePublicPersona] = useState<Persona | null>(
|
||||
null
|
||||
|
@@ -14,15 +14,20 @@ export function orderAssistantsForUser(
|
||||
])
|
||||
);
|
||||
|
||||
assistants = assistants.filter((assistant) =>
|
||||
let filteredAssistants = assistants.filter((assistant) =>
|
||||
chosenAssistantsSet.has(assistant.id)
|
||||
);
|
||||
|
||||
assistants.sort((a, b) => {
|
||||
if (filteredAssistants.length == 0) {
|
||||
return assistants;
|
||||
}
|
||||
|
||||
filteredAssistants.sort((a, b) => {
|
||||
const orderA = assistantOrderMap.get(a.id) ?? Number.MAX_SAFE_INTEGER;
|
||||
const orderB = assistantOrderMap.get(b.id) ?? Number.MAX_SAFE_INTEGER;
|
||||
return orderA - orderB;
|
||||
});
|
||||
return filteredAssistants;
|
||||
}
|
||||
|
||||
return assistants;
|
||||
|
Reference in New Issue
Block a user