Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Share
diff options
context:
space:
mode:
authorHenrik Storch <henrik.storch@nextcloud.com>2022-01-10 11:30:53 +0300
committerHenrik Storch <henrik.storch@nextcloud.com>2022-01-10 14:18:44 +0300
commit4fdcab8927bb36b8892172e89193ad4cdd275964 (patch)
treeeceadcc7f44f678c7d8679baf3a9ad624826835e /Share
parentc85e616f87455d012258f61a637bc42e53ea2844 (diff)
Fix Share ext details
- typo - make sure file names are unique - fix upload counter, easier to read for users Signed-off-by: Henrik Storch <henrik.storch@nextcloud.com>
Diffstat (limited to 'Share')
-rw-r--r--Share/NCShareCell.swift4
-rw-r--r--Share/NCShareExtension+DataSource.swift2
-rw-r--r--Share/NCShareExtension+Files.swift2
-rw-r--r--Share/NCShareExtension+NCDelegate.swift2
-rw-r--r--Share/NCShareExtension.swift2
5 files changed, 4 insertions, 8 deletions
diff --git a/Share/NCShareCell.swift b/Share/NCShareCell.swift
index 70f65540e..c6a6a2a0b 100644
--- a/Share/NCShareCell.swift
+++ b/Share/NCShareCell.swift
@@ -25,7 +25,7 @@ import UIKit
import NCCommunication
protocol NCShareCellDelegate: AnyObject {
- var uploadStated: Bool { get }
+ var uploadStarted: Bool { get }
func removeFile(named fileName: String)
func renameFile(named fileName: String)
}
@@ -65,7 +65,7 @@ class NCShareCell: UITableViewCell {
}
@IBAction func buttonTapped(_ sender: Any) {
- guard !fileName.isEmpty, delegate?.uploadStated != true else { return }
+ guard !fileName.isEmpty, delegate?.uploadStarted != true else { return }
let alertController = UIAlertController(title: "", message: fileName, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: NSLocalizedString("_rename_file_", comment: ""), style: .default) { _ in
diff --git a/Share/NCShareExtension+DataSource.swift b/Share/NCShareExtension+DataSource.swift
index 97267d212..ef2ec2a99 100644
--- a/Share/NCShareExtension+DataSource.swift
+++ b/Share/NCShareExtension+DataSource.swift
@@ -175,8 +175,6 @@ extension NCShareExtension: UITableViewDataSource {
let fileName = filesName[indexPath.row]
cell.setup(fileName: fileName)
cell.delegate = self
- cell.moreButton?.isHidden = filesName.count < 2
-
return cell
}
}
diff --git a/Share/NCShareExtension+Files.swift b/Share/NCShareExtension+Files.swift
index ecebdbce2..8c8d1b47e 100644
--- a/Share/NCShareExtension+Files.swift
+++ b/Share/NCShareExtension+Files.swift
@@ -129,7 +129,7 @@ class NCFilesExtensionHandler {
default: return
}
- if let fileName = fileName { filesName.append(fileName) }
+ if let fileName = fileName, !filesName.contains(fileName) { filesName.append(fileName) }
}
}
}
diff --git a/Share/NCShareExtension+NCDelegate.swift b/Share/NCShareExtension+NCDelegate.swift
index 6898008dd..5005cc44e 100644
--- a/Share/NCShareExtension+NCDelegate.swift
+++ b/Share/NCShareExtension+NCDelegate.swift
@@ -102,8 +102,6 @@ extension NCShareExtension: NCEmptyDataSetDelegate, NCAccountRequestDelegate {
}
extension NCShareExtension: NCShareCellDelegate, NCRenameFileDelegate, NCListCellDelegate {
- // Bug in Swift?
- var uploadStated: Bool { uploadStarted }
func removeFile(named fileName: String) {
guard let index = self.filesName.firstIndex(of: fileName) else {
diff --git a/Share/NCShareExtension.swift b/Share/NCShareExtension.swift
index 9feedd344..aebf3c5e0 100644
--- a/Share/NCShareExtension.swift
+++ b/Share/NCShareExtension.swift
@@ -190,7 +190,7 @@ class NCShareExtension: UIViewController {
@objc func triggerProgressTask(_ notification: NSNotification) {
guard let progress = notification.userInfo?["progress"] as? CGFloat else { return }
- let status = NSLocalizedString("_upload_file_", comment: "") + " \(counterUpload) " + NSLocalizedString("_of_", comment: "") + " \(filesName.count)"
+ let status = NSLocalizedString("_upload_file_", comment: "") + " \(counterUpload + 1) " + NSLocalizedString("_of_", comment: "") + " \(filesName.count)"
IHProgressHUD.show(progress: progress, status: status)
}