Ver código fonte

81110 fix lint

Yohei-Shiina 4 anos atrás
pai
commit
240c1a2229
1 arquivos alterados com 2 adições e 2 exclusões
  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);
   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);
   return useSWR(shouldFetch ? ['/users.list', [...likerIds].join(',')] : null, userFetcher);
 };
 };