1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Cloning of a note should also clone its attachments -> fixes #1904

This commit is contained in:
ehhc
2018-05-20 15:18:49 +02:00
parent 8afa373726
commit f76224bd17
3 changed files with 96 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import moment from 'moment'
import _ from 'lodash'
import ee from 'browser/main/lib/eventEmitter'
import dataApi from 'browser/main/lib/dataApi'
import attachmentManagement from 'browser/main/lib/dataApi/attachmentManagement'
import ConfigManager from 'browser/main/lib/ConfigManager'
import NoteItem from 'browser/components/NoteItem'
import NoteItemSimple from 'browser/components/NoteItemSimple'
@@ -662,6 +663,10 @@ class NoteList extends React.Component {
title: firstNote.title + ' ' + i18n.__('copy'),
content: firstNote.content
})
.then((note) => {
attachmentManagement.cloneAttachments(storage.key, firstNote, note)
return note
})
.then((note) => {
dispatch({
type: 'UPDATE_NOTE',