File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,7 @@ type UpdateCollectionInput = {
208
208
209
209
export default function Page ( ) {
210
210
const transition = useNavigation ( ) ;
211
+ const userDetails = useUserDetails ( ) ;
211
212
const collections = useUserCollections ( ) ;
212
213
const loaderData = useLoaderData < typeof loader > ( ) ;
213
214
const [ toUpdateCollection , setToUpdateCollection ] =
@@ -219,12 +220,15 @@ export default function Page() {
219
220
if ( transition . state !== "submitting" ) setToUpdateCollection ( null ) ;
220
221
} , [ transition . state ] ) ;
221
222
222
- const filteredCollections = collections . filter ( ( c ) => {
223
- let shouldReturn = true ;
224
- if ( query )
225
- shouldReturn = c . name . toLowerCase ( ) . includes ( query . toLowerCase ( ) ) ;
226
- return shouldReturn ;
227
- } ) ;
223
+ const filteredCollections = collections
224
+ . filter (
225
+ ( c ) =>
226
+ c . collaborators . find ( ( c ) => c . collaborator . id === userDetails . id )
227
+ ?. extraInformation ?. isHidden !== true ,
228
+ )
229
+ . filter ( ( c ) =>
230
+ query ? c . name . toLowerCase ( ) . includes ( query . toLowerCase ( ) ) : true ,
231
+ ) ;
228
232
229
233
return (
230
234
< Container size = "sm" >
You can’t perform that action at this time.
0 commit comments