Skip to content

Commit

Permalink
Show correct certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
mathebox committed Sep 14, 2018
1 parent 4f77f08 commit fec7c54
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ class CertificatesListViewController: UITableViewController {
super.viewDidLoad()
self.certificates = self.course.availableCertificates
self.addRefreshControl()
self.setupEmptyState()
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.refresh()
self.setupEmptyState()
}

func stateOfCertificate(withURL certificateURL: URL?) -> String {
Expand Down Expand Up @@ -55,7 +51,7 @@ extension CertificatesListViewController { // TableViewDelegate
}

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard let url = self.certificates[indexPath.row].url else { return }
guard let url = self.certificates[indexPath.section].url else { return }

let pdfViewController = R.storyboard.pdfWebViewController.instantiateInitialViewController().require()
pdfViewController.url = url
Expand Down

0 comments on commit fec7c54

Please sign in to comment.