chore: format
This commit is contained in:
parent
e8f178458f
commit
70dd49740e
1 changed files with 13 additions and 15 deletions
|
@ -96,22 +96,20 @@ function convertNoteEditsToNotes(noteEdits: NoteEdit[]) {
|
||||||
emojis: note.value.emojis,
|
emojis: note.value.emojis,
|
||||||
};
|
};
|
||||||
|
|
||||||
return [now]
|
return [now].concat(noteEdits).map((noteEdit: NoteEdit, index, arr): Note => {
|
||||||
.concat(noteEdits)
|
return Object.assign({}, note.value, {
|
||||||
.map((noteEdit: NoteEdit, index, arr): Note => {
|
historyId: noteEdit.id,
|
||||||
return Object.assign({}, note.value, {
|
// Conversion from updatedAt to createdAt
|
||||||
historyId: noteEdit.id,
|
// The createdAt of a edition's content is actually the updatedAt of the previous one.
|
||||||
// Conversion from updatedAt to createdAt
|
createdAt: arr[(index + 1) % arr.length].updatedAt,
|
||||||
// The createdAt of a edition's content is actually the updatedAt of the previous one.
|
text: noteEdit.text,
|
||||||
createdAt: arr[(index + 1) % arr.length].updatedAt,
|
cw: noteEdit.cw,
|
||||||
text: noteEdit.text,
|
_shouldInsertAd_: false,
|
||||||
cw: noteEdit.cw,
|
files: noteEdit.files,
|
||||||
_shouldInsertAd_: false,
|
fileIds: noteEdit.fileIds,
|
||||||
files: noteEdit.files,
|
emojis: note.value.emojis.concat(noteEdit.emojis),
|
||||||
fileIds: noteEdit.fileIds,
|
|
||||||
emojis: note.value.emojis.concat(noteEdit.emojis),
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue