mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-08 11:58:34 +02:00
unify toggling (#3378)
This commit is contained in:
parent
970320bd49
commit
0746e0be5b
@ -353,13 +353,9 @@ export function CCPairIndexingStatusTable({
|
||||
);
|
||||
};
|
||||
const toggleSources = () => {
|
||||
const currentToggledCount =
|
||||
Object.values(connectorsToggled).filter(Boolean).length;
|
||||
const shouldToggleOn = currentToggledCount < sortedSources.length / 2;
|
||||
|
||||
const connectors = sortedSources.reduce(
|
||||
(acc, source) => {
|
||||
acc[source] = shouldToggleOn;
|
||||
acc[source] = shouldExpand;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<ValidSources, boolean>
|
||||
@ -368,6 +364,7 @@ export function CCPairIndexingStatusTable({
|
||||
setConnectorsToggled(connectors);
|
||||
Cookies.set(TOGGLED_CONNECTORS_COOKIE_NAME, JSON.stringify(connectors));
|
||||
};
|
||||
|
||||
const shouldExpand =
|
||||
Object.values(connectorsToggled).filter(Boolean).length <
|
||||
sortedSources.length;
|
||||
|
Loading…
x
Reference in New Issue
Block a user