Skip to content

Commit

Permalink
fix(integration): check if workspace search source is defined (#1609)
Browse files Browse the repository at this point in the history
  • Loading branch information
pelord committed Mar 28, 2024
1 parent 32bbddb commit 0fd5c83
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/integration/src/lib/search/search.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@ export class SearchState {
const wksSource = this.searchSourceService
.getSources()
.find((source) => source.getId() === 'workspace');
this.workspaceState.store.entities$.subscribe((e) => {
const searchableWks = e.filter(
(fw) =>
fw instanceof FeatureWorkspace &&
fw.layer.options.workspace.searchIndexEnabled
);
this.searchSourceService.setWorkspaces(wksSource, searchableWks);
});
if (wksSource) {
this.workspaceState.store.entities$.subscribe((e) => {
const searchableWks = e.filter(
(fw) =>
fw instanceof FeatureWorkspace &&
fw.layer.options.workspace.searchIndexEnabled
);
this.searchSourceService.setWorkspaces(wksSource, searchableWks);
});
}
this.monitorLayerDeletion();
}

Expand Down

0 comments on commit 0fd5c83

Please sign in to comment.