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
6 changes: 5 additions & 1 deletion Stepic/SectionsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ class SectionsViewController: UIViewController, ShareableController, UIViewContr
//TODO: Handle error type in section downloading
UIThread.performUI({
self.refreshControl.endRefreshing()
self.emptyDatasetState = EmptyDatasetState.connectionError

if self.course.sections.isEmpty {
self.emptyDatasetState = .connectionError
}

self.tableView.reloadData()
if let m = self.moduleId {
if (1...self.course.sectionsArray.count ~= m) && self.isReachable(section: m - 1) {
Expand Down
8 changes: 3 additions & 5 deletions Stepic/UnitsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ class UnitsViewController: UIViewController, ShareableController, UIViewControll
}

if let section = section {
if section.units.count > 0 {
self.isPlaceholderShown = false
}

section.loadProgressesForUnits(units: section.units, completion: {
UIThread.performUI({
self.tableView.reloadData()
Expand Down Expand Up @@ -268,7 +264,9 @@ class UnitsViewController: UIViewController, ShareableController, UIViewControll
}, error: {
UIThread.performUI({
self.refreshControl.endRefreshing()
self.emptyDatasetState = EmptyDatasetState.connectionError
if self.section?.units.isEmpty ?? true {
self.emptyDatasetState = .connectionError
}
})
self.didRefresh = true
})
Expand Down