File tree 2 files changed +7
-5
lines changed
src/discussions/posts/data
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,12 @@ const usePostList = (ids) => {
11
11
12
12
const sortedIds = useMemo ( ( ) => {
13
13
posts . forEach ( ( post ) => {
14
- if ( post . pinned ) {
15
- pinnedPostsIds . push ( post . id ) ;
16
- } else {
17
- unpinnedPostsIds . push ( post . id ) ;
14
+ if ( post ) {
15
+ if ( post . pinned ) {
16
+ pinnedPostsIds . push ( post . id ) ;
17
+ } else {
18
+ unpinnedPostsIds . push ( post . id ) ;
19
+ }
18
20
}
19
21
} ) ;
20
22
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ const threadsSlice = createSlice({
92
92
if ( ! updatedPages [ page - 1 ] ) {
93
93
updatedPages [ page - 1 ] = ids ;
94
94
} else {
95
- updatedPages [ page - 1 ] = [ ...new Set ( [ ... updatedPages [ page - 1 ] , ...ids ] ) ] ;
95
+ updatedPages [ page - 1 ] = [ ...new Set ( [ updatedPages [ page - 1 ] , ...ids ] ) ] ;
96
96
}
97
97
newState . pages = updatedPages ;
98
98
You can’t perform that action at this time.
0 commit comments