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

[IDLE-000] 요양보호사 워크넷 공고 무한 스크롤 버그 해결 #101

Merged
merged 1 commit into from
Nov 9, 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
Original file line number Diff line number Diff line change
Expand Up @@ -211,27 +211,47 @@ class MainPostBoardViewModel: BaseViewModel, WorkerRecruitmentPostBoardVMable {
if let prevRequest = self.nextPagingRequest {

if let nextPageId = fetchedData.nextPageId {
// 다음값이 있는 경우


// 이전 속성의 다음 페이징 아이디가 있는 경우


switch prevRequest {
case .initial:

// 최초요청이후 다음 아이디(네이티브)가 있음
nextRequest = .paging(source: .native, nextPageId: nextPageId)
case .paging(let source, let nextPageId):

case .paging(let source, _):

// 이전페이징의 호출속성(native or worknet)을 그대로 따라감, 다만 아이디를 새로운 값으로 업데이트
nextRequest = .paging(source: source, nextPageId: nextPageId)

}
} else {
// 다음값이 없는 경우


// 이전 속성의 다음 페이징 아이디가 없는 경우, 즉 해당속성 페이징 종료


switch prevRequest {
case .initial:
// 써드파티 데이터 호출

// 첫번째 호출후 다음 공고가 없음 -> 워크넷 포스트 최초 호출
nextRequest = .paging(source: .thirdParty, nextPageId: nil)

case .paging(let source, _):
switch source {
case .native:
// 써드파티 데이터 호출

// 네이티브 페이징 종료 -> 워크넷 최초호출
nextRequest = .paging(source: .thirdParty, nextPageId: nil)

case .thirdParty:
// 페이징 종료

// 워크넷 페이징 종료
nextRequest = nil

}
}
}
Expand Down
Loading