diff --git a/Sources/Screens/File/FileCopy.swift b/Sources/Screens/File/FileCopy.swift index a08a687a..7aa9671a 100644 --- a/Sources/Screens/File/FileCopy.swift +++ b/Sources/Screens/File/FileCopy.swift @@ -30,7 +30,11 @@ struct FileCopy: View { VStack { if isProcessing, !errorIsPresented { VOSheetProgressView() - Text("Copying \(fileStore.selection.count) item(s).") + if fileStore.selection.count > 1 { + Text("Copying (\(fileStore.selection.count)) items.") + } else { + Text("Copying item.") + } } else if errorIsPresented, errorSeverity == .full { VOErrorIcon() if let errorMessage { @@ -74,7 +78,11 @@ struct FileCopy: View { if result.failed.isEmpty { return true } else { - errorMessage = "Failed to copy \(result.failed.count) item(s)." + if result.failed.count > 1 { + errorMessage = "Failed to copy (\(result.failed.count)) items." + } else { + errorMessage = "Failed to copy item." + } if result.failed.count < fileStore.selection.count { errorSeverity = .partial } else if result.failed.count == fileStore.selection.count { @@ -88,7 +96,11 @@ struct FileCopy: View { errorIsPresented = false dismiss() } failure: { _ in - errorMessage = "Failed to copy \(fileStore.selection.count) item(s)." + if fileStore.selection.count > 1 { + errorMessage = "Failed to copy (\(fileStore.selection.count)) items." + } else { + errorMessage = "Failed to copy item." + } errorSeverity = .full errorIsPresented = true } anyways: { diff --git a/Sources/Screens/File/FileDelete.swift b/Sources/Screens/File/FileDelete.swift index 56940a6c..5377ca12 100644 --- a/Sources/Screens/File/FileDelete.swift +++ b/Sources/Screens/File/FileDelete.swift @@ -28,7 +28,11 @@ struct FileDelete: View { VStack { if isProcessing, !errorIsPresented { VOSheetProgressView() - Text("Deleting \(fileStore.selection.count) item(s).") + if fileStore.selection.count > 1 { + Text("Deleting (\(fileStore.selection.count)) items.") + } else { + Text("Deleting item.") + } } else if errorIsPresented, errorSeverity == .full { VOErrorIcon() if let errorMessage { @@ -70,7 +74,11 @@ struct FileDelete: View { if result.failed.isEmpty { return true } else { - errorMessage = "Failed to delete \(result.failed.count) item(s)." + if result.failed.count > 1 { + errorMessage = "Failed to delete (\(result.failed.count)) items." + } else { + errorMessage = "Failed to delete item." + } if result.failed.count < fileStore.selection.count { errorSeverity = .partial } else if result.failed.count == fileStore.selection.count { @@ -84,7 +92,11 @@ struct FileDelete: View { errorIsPresented = false dismiss() } failure: { _ in - errorMessage = "Failed to delete \(fileStore.selection.count) item(s)." + if fileStore.selection.count > 1 { + errorMessage = "Failed to delete (\(fileStore.selection.count)) items." + } else { + errorMessage = "Failed to delete item." + } errorSeverity = .full errorIsPresented = true } anyways: { diff --git a/Sources/Screens/File/FileDownload.swift b/Sources/Screens/File/FileDownload.swift index 1ab5761d..e5350a63 100644 --- a/Sources/Screens/File/FileDownload.swift +++ b/Sources/Screens/File/FileDownload.swift @@ -31,7 +31,11 @@ struct FileDownload: View { VStack { if isProcessing, !errorIsPresented { VOSheetProgressView() - Text("Downloading \(fileStore.selectionFiles.count) item(s).") + if fileStore.selectionFiles.count > 1 { + Text("Downloading (\(fileStore.selectionFiles.count)) items.") + } else { + Text("Downloading item.") + } } else if errorIsPresented, errorSeverity == .full { VOErrorIcon() if let errorMessage { @@ -72,6 +76,7 @@ struct FileDownload: View { .presentationDetents([.fraction(0.25)]) } + // swiftlint:disable:next function_body_length private func performDownload() { let dispatchGroup = DispatchGroup() urls.removeAll() @@ -110,7 +115,11 @@ struct FileDownload: View { dismiss() } else { let count = fileStore.selection.count - urls.count - errorMessage = "Failed to download \(count) item(s)." + if count > 1 { + errorMessage = "Failed to download (\(count)) items." + } else { + errorMessage = "Failed to download item." + } if count < fileStore.selection.count { errorSeverity = .partial } else { diff --git a/Sources/Screens/File/FileMove.swift b/Sources/Screens/File/FileMove.swift index 2a27de69..5f869df3 100644 --- a/Sources/Screens/File/FileMove.swift +++ b/Sources/Screens/File/FileMove.swift @@ -30,7 +30,11 @@ struct FileMove: View { VStack { if isProcessing, !errorIsPresented { VOSheetProgressView() - Text("Moving \(fileStore.selection.count) item(s).") + if fileStore.selection.count > 1 { + Text("Moving (\(fileStore.selection.count)) items.") + } else { + Text("Moving item.") + } } else if errorIsPresented, errorSeverity == .full { VOErrorIcon() if let errorMessage { @@ -72,7 +76,11 @@ struct FileMove: View { if result.failed.isEmpty { return true } else { - errorMessage = "Failed to move \(result.failed.count) item(s)." + if result.failed.count > 1 { + errorMessage = "Failed to move (\(result.failed.count)) items." + } else { + errorMessage = "Failed to move item." + } if result.failed.count < fileStore.selection.count { errorSeverity = .partial } else if result.failed.count == fileStore.selection.count { @@ -86,7 +94,11 @@ struct FileMove: View { errorIsPresented = false dismiss() } failure: { _ in - errorMessage = "Failed to move \(fileStore.selection.count) item(s)." + if fileStore.selection.count > 1 { + errorMessage = "Failed to move (\(fileStore.selection.count)) items." + } else { + errorMessage = "Failed to move item." + } errorSeverity = .full errorIsPresented = true } anyways: { diff --git a/Sources/Screens/File/FileStore.swift b/Sources/Screens/File/FileStore.swift index e49a4451..73115c82 100644 --- a/Sources/Screens/File/FileStore.swift +++ b/Sources/Screens/File/FileStore.swift @@ -38,7 +38,7 @@ class FileStore: ObservableObject { } @Published var renameIsPresented = false - @Published var deleteIsPresented = false + @Published var deleteConfirmationIsPresented = false @Published var downloadIsPresented = false @Published var browserForMoveIsPresented = false @Published var browserForCopyIsPresented = false diff --git a/Sources/Screens/File/FileUpload.swift b/Sources/Screens/File/FileUpload.swift index 752a1267..788cf27b 100644 --- a/Sources/Screens/File/FileUpload.swift +++ b/Sources/Screens/File/FileUpload.swift @@ -32,7 +32,11 @@ struct FileUpload: View { VStack { if isProcessing, !errorIsPresented { VOSheetProgressView() - Text("Uploading \(urls.count) item(s).") + if urls.count > 1 { + Text("Uploading (\(urls.count)) items.") + } else { + Text("Uploading item.") + } } else if errorIsPresented, errorSeverity == .full { VOErrorIcon() if let errorMessage { @@ -94,7 +98,11 @@ struct FileUpload: View { errorIsPresented = false dismiss() } else { - errorMessage = "Failed to upload \(failedCount) item(s)." + if failedCount > 1 { + errorMessage = "Failed to upload (\(failedCount)) items." + } else { + errorMessage = "Failed to upload item." + } if failedCount == urls.count { errorSeverity = .full } else if failedCount < urls.count { diff --git a/Sources/Screens/Sharing/SharingBatch.swift b/Sources/Screens/Sharing/SharingBatch.swift index 5239876a..7350731a 100644 --- a/Sources/Screens/Sharing/SharingBatch.swift +++ b/Sources/Screens/Sharing/SharingBatch.swift @@ -54,8 +54,6 @@ struct SharingBatch: View, TokenDistributing { } } } - .navigationBarTitleDisplayMode(.inline) - .navigationTitle("Sharing") .onAppear { if let token = tokenStore.token { assignTokenToStores(token) diff --git a/Sources/Screens/Sharing/SharingGroupPermission.swift b/Sources/Screens/Sharing/SharingGroupPermission.swift index baee1543..81543614 100644 --- a/Sources/Screens/Sharing/SharingGroupPermission.swift +++ b/Sources/Screens/Sharing/SharingGroupPermission.swift @@ -100,7 +100,7 @@ struct SharingGroupPermission: View, FormValidatable, ErrorPresentable { } } .navigationBarTitleDisplayMode(.inline) - .navigationTitle("Group Permission") + .navigationTitle(fileIDs.count > 1 ? "Sharing (\(fileIDs.count)) Items" : "Sharing") .toolbar { if enableCancel { ToolbarItem(placement: .topBarLeading) { diff --git a/Sources/Screens/Sharing/SharingUserPermission.swift b/Sources/Screens/Sharing/SharingUserPermission.swift index 6b183dc7..d18feac3 100644 --- a/Sources/Screens/Sharing/SharingUserPermission.swift +++ b/Sources/Screens/Sharing/SharingUserPermission.swift @@ -103,7 +103,7 @@ struct SharingUserPermission: View, FormValidatable, ErrorPresentable { } } .navigationBarTitleDisplayMode(.inline) - .navigationTitle("User Permission") + .navigationTitle(fileIDs.count > 1 ? "Sharing (\(fileIDs.count)) Items" : "Sharing") .toolbar { if enableCancel { ToolbarItem(placement: .topBarLeading) {