Skip to content

Commit

Permalink
fix(hub-common): get searchCategories with default value
Browse files Browse the repository at this point in the history
  • Loading branch information
sansth1010 committed Feb 7, 2025
1 parent 2f1ba95 commit 04f5fd7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getWithDefault } from "../../objects";
import { IHubCollectionPersistance } from "../../search/types/IHubCatalog";
import { WellKnownCollection } from "../../search/wellKnownCatalog";
import { IModel } from "../../types";
Expand Down Expand Up @@ -77,7 +78,8 @@ export function applyDefaultCollectionMigration(model: IModel): IModel {
{ key: SearchCategories.APPS_AND_MAPS },
];
const legacySearchCategories: any[] =
model.data.values.searchCategories || DEFAULT_SEARCH_CATEGORIES;
getWithDefault(model.data, "values.searchCategories", undefined) ||
DEFAULT_SEARCH_CATEGORIES;

const configuredCollections = legacySearchCategories
// The new search view doesn't currently allow for searching events
Expand Down

0 comments on commit 04f5fd7

Please sign in to comment.