1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Merge branch 'master' of github.com:laurent22/joplin

This commit is contained in:
Laurent Cozic
2020-02-11 22:29:02 +00:00
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');
}
}