mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Merge branch 'master' of https://github.com/BoostIO/Boostnote into paste_storage_link_should_clone_attachment
# Conflicts: # browser/main/lib/dataApi/attachmentManagement.js # locales/da.json # locales/de.json # locales/en.json # locales/es-ES.json # locales/fa.json # locales/fr.json # locales/hu.json # locales/it.json # locales/ja.json # locales/ko.json # locales/no.json # locales/pl.json # locales/pt-BR.json # locales/pt-PT.json # locales/ru.json # locales/sq.json # locales/zh-CN.json # locales/zh-TW.json
This commit is contained in:
@@ -272,6 +272,9 @@ function deleteAttachmentFolder (storageKey, noteKey) {
|
||||
* @param noteKey NoteKey of the current note. Is used to determine the belonging attachment folder.
|
||||
*/
|
||||
function deleteAttachmentsNotPresentInNote (markdownContent, storageKey, noteKey) {
|
||||
if (storageKey == null || noteKey == null || markdownContent == null) {
|
||||
return
|
||||
}
|
||||
const targetStorage = findStorage.findStorage(storageKey)
|
||||
const attachmentFolder = path.join(targetStorage.path, DESTINATION_FOLDER, noteKey)
|
||||
const attachmentsInNote = getAttachmentsInContent(markdownContent)
|
||||
@@ -281,7 +284,6 @@ function deleteAttachmentsNotPresentInNote (markdownContent, storageKey, noteKey
|
||||
attachmentsInNoteOnlyFileNames.push(attachmentsInNote[i].replace(new RegExp(STORAGE_FOLDER_PLACEHOLDER + escapeStringRegexp(path.sep) + noteKey + escapeStringRegexp(path.sep), 'g'), ''))
|
||||
}
|
||||
}
|
||||
|
||||
if (fs.existsSync(attachmentFolder)) {
|
||||
fs.readdir(attachmentFolder, (err, files) => {
|
||||
if (err) {
|
||||
|
||||
Reference in New Issue
Block a user