Skip to content

Commit

Permalink
maintain recent ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianWhitneyAI committed May 6, 2024
1 parent fe33d2e commit 289829a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions packages/core/state/selection/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ export default makeReducer<SelectionStateBranch>(
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
Expand Down
4 changes: 2 additions & 2 deletions packages/core/state/selection/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 289829a

Please sign in to comment.