Skip to content

[Fix] #138 - 보관함 셀 탭 오류 및 viewWillAppear fetch 이벤트 수정#141

Merged
L-j-h-c merged 2 commits intoTeamRecorDream:developfrom
L-j-h-c:fix/#138
Feb 3, 2023
Merged

[Fix] #138 - 보관함 셀 탭 오류 및 viewWillAppear fetch 이벤트 수정#141
L-j-h-c merged 2 commits intoTeamRecorDream:developfrom
L-j-h-c:fix/#138

Conversation

@L-j-h-c
Copy link
Copy Markdown
Contributor

@L-j-h-c L-j-h-c commented Feb 3, 2023

👻 작업한 내용

보관함 셀 탭 오류 및 viewWillAppear fetch 이벤트 수정

🎤 PR Point

  1. MultiSelection이 true로 되어 있고, deselect가 false로 되어 있어 셀이 탭 되지 않는 오류를 수정했습니다.
  2. viewWillAppear와 dismissDetail의 fetch 이벤트를 분기했습니다.

📮 관련 이슈

@L-j-h-c L-j-h-c self-assigned this Feb 3, 2023
Copy link
Copy Markdown
Member

@EunHee-Jeong EunHee-Jeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 가보자고~!

Comment on lines +214 to +221
let viewWillAppear = self.rx.viewWillAppear
.do { [weak self] _ in
guard let self = self else { return }
self.dreamFilterCollectionView.selectItem(
at: .init(row: 0, section: 0),
animated: false,
scrollPosition: .top)
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옹 이런 식으로 viewWillAppear를 빼주면 필터에서 선택된 셀이 바뀔 때마다 패치해올 수 있겠군요 !!! 훨씬 좋다 👍👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EunHee-Jeong 요 부분은 viewWillAppear 시에 선택된 필터 셀을 0으로 초기화해주기 위해 넣은 부분이에요~~

Comment on lines +53 to +73
input.filterButtonTapped
.withUnretained(self)
.subscribe(onNext: { owner, selectedType in
owner.useCase.execute(requestValue: .init(filterType: selectedType))
owner.previousFetchQuery = .init(filterType: selectedType)
}).disposed(by: disposeBag)

input.viewWillAppear.subscribe(onNext: { _ in
self.useCase.execute(requestValue: .init(filterType: 0))
output.loadingStatus.accept(true)
}).disposed(by: disposeBag)
input.viewWillAppear
.withUnretained(self)
.subscribe(onNext: { owner, _ in
owner.useCase.execute(requestValue: .init(filterType: 0))
owner.previousFetchQuery = .init(filterType: 0)
output.loadingStatus.accept(true)
}).disposed(by: disposeBag)

input.dismissDetail
.withUnretained(self)
.subscribe(onNext: { owner, _ in
owner.useCase.execute(requestValue: owner.previousFetchQuery)
output.loadingStatus.accept(true)
}).disposed(by: disposeBag)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

필터가 눌렸을 때 previousFetchQuery 를 킵해두고, 새롭게 패치해야 하는 상황과 유지해야 하는 상황 모두에 사용했네요 와우 이거 대박이군... 근데 내가 이해한 게 맞나...?!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EunHee-Jeong 넵넵 이전 쿼리를 기억하기 위해 사용했습니당~

@L-j-h-c L-j-h-c merged commit f3b12b0 into TeamRecorDream:develop Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 보관함 snapshot 로직 추가

2 participants