Skip to content

Commit 86c5067

Browse files
authored
fix filters (codesandbox#3791)
1 parent 1e12711 commit 86c5067

File tree

2 files changed

+6
-6
lines changed
  • packages

2 files changed

+6
-6
lines changed

packages/app/src/app/overmind/namespaces/comments/state.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,17 @@ export const state: State = {
144144
comment =>
145145
comment.parentComment == null && comment.id !== OPTIMISTIC_COMMENT_ID
146146
);
147-
148147
switch (selectedCommentsFilter) {
149148
case CommentsFilterOption.ALL:
150149
return rootComments.sort(sortByInsertedAt);
151150
case CommentsFilterOption.RESOLVED:
152-
return rootComments.sort(sortByInsertedAt);
151+
return rootComments
152+
.filter(comment => comment.isResolved)
153+
.sort(sortByInsertedAt);
153154
case CommentsFilterOption.OPEN:
154-
return rootComments.sort(sortByInsertedAt);
155-
case CommentsFilterOption.MENTIONS:
156-
return rootComments.sort(sortByInsertedAt);
155+
return rootComments
156+
.filter(comment => !comment.isResolved)
157+
.sort(sortByInsertedAt);
157158
default:
158159
return [];
159160
}

packages/common/src/types/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ export enum CommentsFilterOption {
315315
ALL = 'All',
316316
OPEN = 'Open',
317317
RESOLVED = 'Resolved',
318-
MENTIONS = 'Mentions',
319318
}
320319

321320
export type Sandbox = {

0 commit comments

Comments
 (0)