1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Desktop: Support export of multiple notes to PDF files. (#2468)

* Support export of multiple notes to pdf files.

* Update in response to review comments.

Find unique filenames when exporting multiple pdfs.
Simplify delay.

* Eliminate redundant retries and fix error message in fs shim unique filename search.

* Make output filenames consistent between single and multi pdf export.

* Remove unnecessary white space.

* Remove legacy sleep in pdf export and add a little more variability to unique filename search.
This commit is contained in:
mic704b
2020-02-12 01:14:04 +11:00
committed by GitHub
parent 4bd326f72c
commit 573b744293
4 changed files with 75 additions and 73 deletions

View File

@ -37,8 +37,11 @@ class FsDriverBase {
if (!exists) return nameToTry;
nameToTry = `${nameNoExt} (${counter})${extension}`;
counter++;
if (counter >= 1000) nameToTry = `${nameNoExt} (${new Date().getTime()})${extension}`;
if (counter >= 10000) throw new Error('Cannot find unique title');
if (counter >= 1000) {
nameToTry = `${nameNoExt} (${new Date().getTime()})${extension}`;
await time.msleep(10);
}
if (counter >= 1100) throw new Error('Cannot find unique filename');
}
}