diff --git a/packages/core/state/selection/reducer.ts b/packages/core/state/selection/reducer.ts index e2918c4c8..af9a0e2e9 100644 --- a/packages/core/state/selection/reducer.ts +++ b/packages/core/state/selection/reducer.ts @@ -99,8 +99,6 @@ export default makeReducer( fileGridColumnCount: action.payload, }), [SET_FILE_FILTERS]: (state, action) => { - console.log("Filter: ", action.payload); - const recentAnnotations = Array.from( new Set([ // get annotaionName from each filter and add to recents diff --git a/packages/core/state/selection/selectors.ts b/packages/core/state/selection/selectors.ts index 0ef6370cb..113848853 100644 --- a/packages/core/state/selection/selectors.ts +++ b/packages/core/state/selection/selectors.ts @@ -83,8 +83,8 @@ export const getSortedAnnotations = createSelector( [getAnnotations, getRecentAnnotations], (annotations: Annotation[], recentAnnotationNames: string[]) => { // Create Array of annotations from recentAnnotationNames - const recentAnnotations = annotations.filter((annotation) => - recentAnnotationNames.includes(annotation.name) + const recentAnnotations = recentAnnotationNames.flatMap((name) => + annotations.filter((annotation) => annotation.name === name) ); // get the File name annotaion in a list (if Present)