mirror of https://github.com/laurent22/joplin.git
Apply linter
parent
a5f17fad58
commit
008e30bdb7
|
@ -166,8 +166,8 @@ class ScreenHeaderComponent extends React.PureComponent {
|
||||||
async duplicateButton_press() {
|
async duplicateButton_press() {
|
||||||
const noteIds = this.props.selectedNoteIds;
|
const noteIds = this.props.selectedNoteIds;
|
||||||
|
|
||||||
//Duplicate all selected notes. ensureUniqueTitle is set to true to use the
|
// Duplicate all selected notes. ensureUniqueTitle is set to true to use the
|
||||||
//original note's name as a root for the new unique identifier.
|
// original note's name as a root for the new unique identifier.
|
||||||
await Note.duplicateMultipleNotes(noteIds, {ensureUniqueTitle: true});
|
await Note.duplicateMultipleNotes(noteIds, {ensureUniqueTitle: true});
|
||||||
|
|
||||||
this.props.dispatch({ type: 'NOTE_SELECTION_END' });
|
this.props.dispatch({ type: 'NOTE_SELECTION_END' });
|
||||||
|
|
|
@ -481,17 +481,15 @@ class Note extends BaseItem {
|
||||||
return note;
|
return note;
|
||||||
}
|
}
|
||||||
|
|
||||||
static async duplicateMultipleNotes(noteIds, options = null){
|
static async duplicateMultipleNotes(noteIds, options = null) {
|
||||||
/*
|
// if options.uniqueTitle is true, a unique title for the duplicated file will be assigned.
|
||||||
if options.uniqueTitle is true, a unique title for the duplicated file will be assigned.
|
|
||||||
*/
|
|
||||||
const ensureUniqueTitle = options && options.ensureUniqueTitle;
|
const ensureUniqueTitle = options && options.ensureUniqueTitle;
|
||||||
|
|
||||||
for(const noteId of noteIds){
|
for (const noteId of noteIds) {
|
||||||
const noteOptions = {};
|
const noteOptions = {};
|
||||||
|
|
||||||
//If ensureUniqueTitle is truthy, set the original note's name as root for the unique title.
|
// If ensureUniqueTitle is truthy, set the original note's name as root for the unique title.
|
||||||
if(ensureUniqueTitle){
|
if (ensureUniqueTitle) {
|
||||||
const originalNote = await Note.load(noteId);
|
const originalNote = await Note.load(noteId);
|
||||||
noteOptions.uniqueTitle = originalNote.title;
|
noteOptions.uniqueTitle = originalNote.title;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue