Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#68 fix: updateProgress 함수 누락 수정 #76

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ const MainPage = () => {
useEffect(() => {
fetchBlockData(0); // 트리거가 변경되면 다시 데이터 호출
}, [fetchTrigger]);
// 블록 순서 변경 디바운스 처리
const debouncedData = useDebounce(columns, 10);

useEffect(() => {
const orderArray = {
Expand All @@ -184,7 +182,6 @@ const MainPage = () => {

// * get 대시보드 블록
const fetchBlockData = async (page: number = 0) => {

try {
// 완료된 블록의 진행률을 다시 받아옴
const updatedDashboardDetail = await getPersonalDashboard(dashboardId);
Expand All @@ -194,6 +191,15 @@ const MainPage = () => {
}
};

const updateProgress = async () => {
try {
// 완료된 블록의 진행률을 다시 받아옴
const updatedDashboardDetail = await getPersonalDashboard(dashboardId);
setDashboardDetail(updatedDashboardDetail); // 진행률 업데이트
} catch (error) {
console.error('Error updating progress', error);
}
};
// 세로 무한 스크롤 감지 이벤트
const handleLoadMore = async () => {
setPage(prevPage => prevPage + 1);
Expand Down