Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions ownCloud/Settings/AutoUploadSettingsSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ class AutoUploadSettingsSection: SettingsSection {
updateDynamicUI()
}
}

NotificationCenter.default.post(name: .OCBookmarkManagerListChanged, object: nil)
}

private func setupVideoAutoUpload(enabled:Bool) {
Expand All @@ -226,6 +228,8 @@ class AutoUploadSettingsSection: SettingsSection {
updateDynamicUI()
}
}

NotificationCenter.default.post(name: .OCBookmarkManagerListChanged, object: nil)
}

private func getSelectedBookmark(for mediaType:MediaType) -> OCBookmark? {
Expand Down
12 changes: 10 additions & 2 deletions ownCloud/Settings/MediaUploadSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,16 @@ class MediaUploadSettingsViewController: StaticTableViewController {
if let autoUploadSection = self.autoUploadSection, !autoUploadSection.attached {
self.addSection(autoUploadSection)
}
if let backgroundUploadsSection = self.backgroundUploadsSection, backgroundUploadsSection.rows.count > 0, !backgroundUploadsSection.attached {
self.addSection(backgroundUploadsSection)
if let backgroundUploadsSection = self.backgroundUploadsSection {
if !backgroundUploadsSection.attached, backgroundUploadsSection.rows.count > 0, (userDefaults.instantUploadPhotos || userDefaults.instantUploadVideos) {
if let autoUploadSection = self.autoUploadSection, let index = self.indexForSection(autoUploadSection) {
self.insertSection(backgroundUploadsSection, at: (index + 1), animated: true)
} else {
self.addSection(backgroundUploadsSection)
}
} else {
self.removeSection(backgroundUploadsSection, animated: true)
}
}
} else {
if let autoUploadSection = self.autoUploadSection, autoUploadSection.attached {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ open class StaticTableViewController: UITableViewController, Themeable {
return nil
}

open func indexForSection(_ inSection: StaticTableViewSection) -> Int? {
return sections.index(of: inSection)
}

// MARK: - View Controller
override open func viewDidLoad() {
super.viewDidLoad()
Expand Down