Skip to content

Commit

Permalink
Merge pull request #77 from themoment-team/hotfix/gwangyaList
Browse files Browse the repository at this point in the history
[Hotfix] Resolve Gwangya Post List error
  • Loading branch information
hyeongrok7874 committed Dec 4, 2023
2 parents ae85ee1 + dd8cac0 commit 0ea044a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/hooks/api/gwangya/useGetGwangyaPostList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useInfiniteQuery } from '@tanstack/react-query';

import { get, gwangyaQueryKeys, gwangyaUrl } from '@/libs';
import type { GwangyaPostType } from '@/types';
import { getGwangyaToken } from '@/utils';
import { getGwangyaToken, minutesToMs } from '@/utils';

const gwangyaToken = getGwangyaToken();

Expand All @@ -25,4 +25,6 @@ export const useGetGwangyaPostList = (initialData?: GwangyaPostType[]) =>
getPreviousPageParam: (firstPage) => firstPage[0]?.id,
getNextPageParam: (lastPage) => lastPage[lastPage.length - 1]?.id,
initialData: initialData && { pages: [initialData], pageParams: [0] },
staleTime: minutesToMs(5),
gcTime: minutesToMs(5),
});
2 changes: 1 addition & 1 deletion src/pageContainer/gwangya/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Gwangya: React.FC<Props> = ({ initialData }) => {

useEffect(() => {
// 초기 데이터를 가져올 시, 스크롤을 최하단으로 이동
postListRef.current?.scrollTo(0, 10000);
postListRef.current?.scrollTo(0, 99999);

const isSuccess = isExistCookie('isSuccess');

Expand Down
1 change: 1 addition & 0 deletions src/pageContainer/gwangya/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const LoadMoreTrigger = styled.div`
`;

export const PostList = styled.div<{ isFetching: boolean }>`
height: 100%;
display: flex;
flex-direction: column;
gap: 2.25rem;
Expand Down

0 comments on commit 0ea044a

Please sign in to comment.