2
0
Yohei-Shiina 4 жил өмнө
parent
commit
240c1a2229

+ 2 - 2
packages/app/src/stores/user.tsx

@@ -6,7 +6,7 @@ const userFetcher = (endpoint:string, userIds:string) => {
   return apiGet(endpoint, { user_ids: userIds }).then((response:any) => response.users);
 };
 
-export const useSWRxLikerList = (likerIds?: string[]): SWRResponse<IUser[], Error> => {
-  const shouldFetch = likerIds != null && likerIds.length > 0;
+export const useSWRxLikerList = (likerIds: string[] = []): SWRResponse<IUser[], Error> => {
+  const shouldFetch = likerIds.length > 0;
   return useSWR(shouldFetch ? ['/users.list', [...likerIds].join(',')] : null, userFetcher);
 };