From c7454d406e7feae100f359e63869e3b28df1b338 Mon Sep 17 00:00:00 2001 From: Archie Agarwal Date: Mon, 23 Jun 2025 11:32:41 +0530 Subject: [PATCH] reviewd --- .../Controls/Settings/SettingsComponent.tsx | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/Explorer/Controls/Settings/SettingsComponent.tsx b/src/Explorer/Controls/Settings/SettingsComponent.tsx index b463bcbc1..16118cc2b 100644 --- a/src/Explorer/Controls/Settings/SettingsComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsComponent.tsx @@ -1,4 +1,5 @@ import { IPivotItemProps, IPivotProps, Pivot, PivotItem } from "@fluentui/react"; +import { readCollection } from "Common/dataAccess/readCollection"; import { ComputedPropertiesComponent, ComputedPropertiesComponentProps, @@ -934,23 +935,12 @@ export class SettingsComponent extends React.Component => { - const storePolicy = useIndexingPolicyStore.getState().indexingPolicy; - if (!storePolicy) { - console.warn("No indexing policy found in store."); - return; - } - const indexingPolicy: DataModels.IndexingPolicy = { - ...storePolicy, - automatic: storePolicy.automatic ?? true, - indexingMode: storePolicy.indexingMode ?? "consistent", - includedPaths: storePolicy.includedPaths ?? [], - excludedPaths: storePolicy.excludedPaths ?? [], - }; - - this.collection.indexingPolicy(indexingPolicy); + const latestCollection = await readCollection(this.collection.databaseId, this.collection.id()); + this.collection.rawDataModel = latestCollection; + this.collection.indexingPolicy(latestCollection.indexingPolicy); this.setState({ - indexingPolicyContent: indexingPolicy, - indexingPolicyContentBaseline: indexingPolicy, + indexingPolicyContent: latestCollection.indexingPolicy, + indexingPolicyContentBaseline: latestCollection.indexingPolicy, }); };