Skip to content

Commit

Permalink
NMC 2261 - Empty filename alert issue
Browse files Browse the repository at this point in the history
  • Loading branch information
TSI-amrutwaghmare committed Jul 17, 2024
1 parent c49c814 commit 13df317
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud

if let fileNameNew = formRow.value as? String {
self.fileName = utility.removeForbiddenCharacters(fileNameNew)
} else {
self.fileName = ""
}


Expand Down Expand Up @@ -218,9 +220,8 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
}

@objc func save() {

let rowFileName: XLFormRowDescriptor = self.form.formRow(withTag: "fileName")!
guard let name = (rowFileName.value as? String)?.trimmingCharacters(in: .whitespaces) else {
let name = self.fileName
guard name.trimmingCharacters(in: .whitespaces) != "" else {
let alert = UIAlertController(title: "", message: NSLocalizedString("_prompt_insert_file_name", comment: ""), preferredStyle: .alert)
alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .cancel, handler: nil))
self.present(alert, animated: true)
Expand Down

0 comments on commit 13df317

Please sign in to comment.