mirror of
https://github.com/PhilKes/NotallyX.git
synced 2025-06-28 12:19:55 +00:00
Fix export PDF file name if title is blank
This commit is contained in:
parent
01ac48f930
commit
cf7f6f9dda
1 changed files with 3 additions and 2 deletions
|
@ -517,13 +517,14 @@ fun exportPdfFile(
|
|||
total: Int? = null,
|
||||
duplicateFileCount: Int = 1,
|
||||
) {
|
||||
val filePath = "$fileName.${ExportMimeType.PDF.fileExtension}"
|
||||
val validFileName = fileName.ifBlank { app.getString(R.string.note) }
|
||||
val filePath = "$validFileName.${ExportMimeType.PDF.fileExtension}"
|
||||
if (folder.findFile(filePath)?.exists() == true) {
|
||||
return exportPdfFile(
|
||||
app,
|
||||
note,
|
||||
folder,
|
||||
"${fileName.removeTrailingParentheses()} ($duplicateFileCount)",
|
||||
"${validFileName.removeTrailingParentheses()} ($duplicateFileCount)",
|
||||
pdfPrintListener,
|
||||
progress,
|
||||
counter,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue