mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-25 11:16:43 +02:00
update organization (#3118)
* update organization * minor clean up * add minor clarity * k * slight rejigger * alembic fix * update paradigm * delete code! * delete code * minor update
This commit is contained in:
@@ -343,8 +343,6 @@ export function AssistantsList() {
|
||||
|
||||
setCurrentlyVisibleAssistants(updatedAssistants);
|
||||
await updateUserAssistantList(updatedAssistants.map((a) => a.id));
|
||||
await refreshUser();
|
||||
await refreshAssistants();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -61,8 +61,6 @@ export function AssistantsTab({
|
||||
|
||||
setAssistants(updatedAssistants);
|
||||
await updateUserAssistantList(updatedAssistants.map((a) => a.id));
|
||||
await refreshUser();
|
||||
await refreshAssistants();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -47,7 +47,7 @@ export const AssistantsProvider: React.FC<{
|
||||
const [assistants, setAssistants] = useState<Persona[]>(
|
||||
initialAssistants || []
|
||||
);
|
||||
const { user, isLoadingUser, refreshUser, isAdmin } = useUser();
|
||||
const { user, isLoadingUser, isAdmin } = useUser();
|
||||
const [editablePersonas, setEditablePersonas] = useState<Persona[]>([]);
|
||||
const [allAssistants, setAllAssistants] = useState<Persona[]>([]);
|
||||
|
||||
|
@@ -35,16 +35,14 @@ export function classifyAssistants(user: User | null, assistants: Persona[]) {
|
||||
const isNotHidden = !user.preferences?.hidden_assistants?.includes(
|
||||
assistant.id
|
||||
);
|
||||
const isSelected = user.preferences?.chosen_assistants?.includes(
|
||||
assistant.id
|
||||
);
|
||||
|
||||
const isBuiltIn = assistant.builtin_persona;
|
||||
const isDefault = assistant.is_default_persona;
|
||||
|
||||
const isOwnedByUser = checkUserOwnsAssistant(user, assistant);
|
||||
|
||||
const isShown =
|
||||
(isVisible && isNotHidden && isSelected) ||
|
||||
(isVisible && isNotHidden) ||
|
||||
(isNotHidden && (isBuiltIn || isDefault || isOwnedByUser));
|
||||
return isShown;
|
||||
});
|
||||
@@ -100,6 +98,7 @@ export function orderAssistantsForUser(
|
||||
const remainingAssistants = assistants.filter(
|
||||
(assistant) => !orderedAssistants.includes(assistant)
|
||||
);
|
||||
|
||||
remainingAssistants.sort((a, b) => {
|
||||
const priorityA = a.display_priority ?? Number.MAX_SAFE_INTEGER;
|
||||
const priorityB = b.display_priority ?? Number.MAX_SAFE_INTEGER;
|
||||
|
Reference in New Issue
Block a user