Skip to content
Open
Show file tree
Hide file tree
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 @@ -62,7 +62,7 @@ final class APPLELOVERCLUBViewController: BaseViewController {
// MARK: - Function

func loadURL() {
if let url = URL(string: "https://1401kms-70595.waveon.me") {
if let url = URL(string: "https://smore.im/quiz/mDC9DH57g2x") {
let urlRequest = URLRequest(url: url)
webView?.load(urlRequest)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ private extension LocationSearchSheetViewController {
self.updateEmptyView(isEmpty: result.isEmpty)
}
.store(in: cancelBag)

output.inValidLocation
.receive(on: DispatchQueue.main)
.sink { _ in
Toast().show(message: "서울 이외의 지역은 아직 준비중이에요", inset: 23, view: self.rootView)
}
.store(in: cancelBag)
}

func createDiffableDataSource() -> UICollectionViewDiffableDataSource<Int, Location> {
Expand Down
16 changes: 14 additions & 2 deletions Roomie/Roomie/Presentation/Home/ViewModel/HomeViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ final class HomeViewModel {
private let didTapHouseDataSubject = PassthroughSubject<Int, Never>()
private let locationSearchDataSubject = PassthroughSubject<MapSearchResponseDTO, Never>()
private let isSuccessSubject = PassthroughSubject<Bool, Never>()
private let invalidLocationSubject = PassthroughSubject<String, Never>()

init(service: HomeServiceProtocol) {
self.service = service
Expand All @@ -40,6 +41,7 @@ extension HomeViewModel: ViewModelType {
let pinnedInfo: AnyPublisher<(Int,Bool), Never>
let locationSearchData: AnyPublisher<MapSearchResponseDTO, Never>
let isSuccess: AnyPublisher<Bool, Never>
let inValidLocation: AnyPublisher<String, Never>
}

func transform(from input: Input, cancelBag: CancelBag) -> Output {
Expand Down Expand Up @@ -114,7 +116,8 @@ extension HomeViewModel: ViewModelType {
houseCount: houseCount,
pinnedInfo: pinnedInfoData,
locationSearchData: locationSearchData,
isSuccess: isSuccess
isSuccess: isSuccess,
inValidLocation: invalidLocationSubject.eraseToAnyPublisher()
)
}
}
Expand Down Expand Up @@ -163,7 +166,16 @@ private extension HomeViewModel {
latitude: latitude,
longitude: longitude,
location: location
), let _ = responseBody.data else { return }
) else {
isSuccessSubject.send(false)
return
}

if responseBody.data?.location.isEmpty == true {
invalidLocationSubject.send(responseBody.message)
return
}
Comment on lines +173 to +177
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

오옹 좋은데요..??


fetchHomeData()
isSuccessSubject.send(true)
} catch {
Expand Down