mirror of https://github.com/status-im/codimd.git
fix: avoid append zero suffix on exporting user data
Signed-off-by: Max Wu <jackymaxj@gmail.com>
This commit is contained in:
parent
37b656df93
commit
db5fc5075a
|
@ -91,8 +91,11 @@ exports.exportMyData = (req, res) => {
|
|||
let filename
|
||||
let suffix = 0
|
||||
do {
|
||||
const separator = suffix === 0 ? '' : '-'
|
||||
filename = basename + separator + suffix + '.md'
|
||||
if (suffix === 0) {
|
||||
filename = basename + '.md'
|
||||
} else {
|
||||
filename = basename + '-' + suffix + '.md'
|
||||
}
|
||||
suffix++
|
||||
} while (filenames[filename])
|
||||
filenames[filename] = true
|
||||
|
|
Loading…
Reference in New Issue