Skip to content
Merged
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 @@ -330,7 +330,7 @@ private class ReaderDetailViewMock: UIViewController, ReaderDetailView {
didCallShowError = true
}

func showErrorWithWebAction() {
func showErrorWithWebAction(error: String?) {
didCallShowErrorWithWebAction = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class ReaderDetailCoordinator {
self?.post = post
self?.renderPostAndBumpStats()
}, failure: { [weak self] error in
self?.postURL == nil ? self?.showError(error: error) : self?.view?.showErrorWithWebAction()
self?.postURL == nil ? self?.showError(error: error) : self?.view?.showErrorWithWebAction(error: error?.localizedDescription)
self?.reportPostLoadFailure()
})
}
Expand All @@ -363,7 +363,7 @@ class ReaderDetailCoordinator {
self?.renderPostAndBumpStats()
}, failure: { [weak self] error in
DDLogError("Error fetching post for detail: \(String(describing: error?.localizedDescription))")
self?.postURL == nil ? self?.showError(error: error) : self?.view?.showErrorWithWebAction()
self?.postURL == nil ? self?.showError(error: error) : self?.view?.showErrorWithWebAction(error: error?.localizedDescription)
self?.reportPostLoadFailure()
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protocol ReaderDetailView: AnyObject {
func renderRelatedPosts(_ posts: [RemoteReaderSimplePost])
func showLoading()
func showError(subtitle: String?)
func showErrorWithWebAction()
func showErrorWithWebAction(error: String?)
func scroll(to: String)
func updateHeader()
func updateLikesView(with viewModel: ReaderDetailLikesViewModel)
Expand Down Expand Up @@ -399,8 +399,8 @@ class ReaderDetailViewController: UIViewController, ReaderDetailView {
}

/// Shown an error with a button to open the post on the browser
func showErrorWithWebAction() {
displayLoadingViewWithWebAction(title: LoadingText.errorLoadingTitle)
func showErrorWithWebAction(error: String?) {
displayLoadingViewWithWebAction(title: LoadingText.errorLoadingTitle, subtitle: error)
}

/// Scroll the content to a given #hash
Expand Down Expand Up @@ -1122,9 +1122,10 @@ private extension ReaderDetailViewController {
showLoadingView()
}

func displayLoadingViewWithWebAction(title: String, accessoryView: UIView? = nil) {
func displayLoadingViewWithWebAction(title: String, subtitle: String? = nil, accessoryView: UIView? = nil) {
noResultsViewController.configure(title: title,
buttonTitle: LoadingText.errorLoadingPostURLButtonTitle,
subtitle: subtitle,
accessoryView: accessoryView)
showLoadingView()
}
Expand Down