mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-27 20:38:32 +02:00
quick fix (#4154)
This commit is contained in:
@@ -29,20 +29,24 @@ export function AccessTypeForm({
|
|||||||
const isAutoSyncSupported = isValidAutoSyncSource(connector);
|
const isAutoSyncSupported = isValidAutoSyncSource(connector);
|
||||||
const { isAdmin } = useUser();
|
const { isAdmin } = useUser();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(
|
||||||
if (!isPaidEnterpriseEnabled) {
|
() => {
|
||||||
access_type_helpers.setValue("public");
|
// Only set default value if access_type.value is not already set
|
||||||
} else if (isAutoSyncSupported) {
|
if (!access_type.value) {
|
||||||
access_type_helpers.setValue("sync");
|
if (!isPaidEnterpriseEnabled) {
|
||||||
} else {
|
access_type_helpers.setValue("public");
|
||||||
access_type_helpers.setValue("private");
|
} else if (isAutoSyncSupported) {
|
||||||
}
|
access_type_helpers.setValue("sync");
|
||||||
}, [
|
} else {
|
||||||
isAutoSyncSupported,
|
access_type_helpers.setValue("private");
|
||||||
isAdmin,
|
}
|
||||||
isPaidEnterpriseEnabled,
|
}
|
||||||
access_type_helpers,
|
},
|
||||||
]);
|
[
|
||||||
|
// Only run this effect once when the component mounts
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
{
|
{
|
||||||
@@ -81,7 +85,6 @@ export function AccessTypeForm({
|
|||||||
Control who has access to the documents indexed by this connector.
|
Control who has access to the documents indexed by this connector.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DefaultDropdown
|
<DefaultDropdown
|
||||||
options={options}
|
options={options}
|
||||||
selected={access_type.value}
|
selected={access_type.value}
|
||||||
@@ -90,7 +93,6 @@ export function AccessTypeForm({
|
|||||||
}
|
}
|
||||||
includeDefault={false}
|
includeDefault={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{access_type.value === "sync" && isAutoSyncSupported && (
|
{access_type.value === "sync" && isAutoSyncSupported && (
|
||||||
<AutoSyncOptions connectorType={connector as ValidAutoSyncSource} />
|
<AutoSyncOptions connectorType={connector as ValidAutoSyncSource} />
|
||||||
)}
|
)}
|
||||||
|
Reference in New Issue
Block a user