Skip to content

Commit 9b4a828

Browse files
committed
#393 added an activity indicator which will be shown, if offline copies will be deleted to give the user a UI feedback
1 parent cc7d2af commit 9b4a828

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ownCloud/Bookmarks/BookmarkInfoViewController.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,21 @@ class BookmarkInfoViewController: StaticTableViewController {
4444
let deviceFreeTitle = String(format: "Free on %@".localized, UIDevice.current.name)
4545
deviceAvailableStorageInfoRow = StaticTableViewRow(valueRowWithAction: nil, title: deviceFreeTitle, value: "uknown".localized)
4646

47-
deleteLocalFilesRow = StaticTableViewRow(buttonWithAction: { [weak self] (_, _) in
47+
deleteLocalFilesRow = StaticTableViewRow(buttonWithAction: { [weak self] (row, _) in
4848
if let bookmark = self?.bookmark {
4949

5050
OCCoreManager.shared.scheduleOfflineOperation({ (bookmark, completionHandler) in
5151
let vault : OCVault = OCVault(bookmark: bookmark)
5252

53+
OnMainThread {
54+
let progressView = UIActivityIndicatorView(style: Theme.shared.activeCollection.activityIndicatorViewStyle)
55+
progressView.startAnimating()
56+
row.cell?.accessoryView = progressView
57+
}
58+
5359
vault.compact(completionHandler: { (_, error) in
5460
OnMainThread {
61+
row.cell?.accessoryView = nil
5562
if error != nil {
5663
// Inform user if vault couldn't be comp acted
5764
let alertController = UIAlertController(title: NSString(format: "Compacting of '%@' failed".localized as NSString, bookmark.shortName as NSString) as String,

0 commit comments

Comments
 (0)