Yohei-Shiina 4 лет назад
Родитель
Сommit
240c1a2229
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/app/src/stores/user.tsx

+ 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);
 };