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