chore: format

This commit is contained in:
Lhcfl 2024-04-01 11:34:57 +08:00
parent e8f178458f
commit 70dd49740e
1 changed files with 13 additions and 15 deletions

View File

@ -96,22 +96,20 @@ function convertNoteEditsToNotes(noteEdits: NoteEdit[]) {
emojis: note.value.emojis,
};
return [now]
.concat(noteEdits)
.map((noteEdit: NoteEdit, index, arr): Note => {
return Object.assign({}, note.value, {
historyId: noteEdit.id,
// Conversion from updatedAt to createdAt
// The createdAt of a edition's content is actually the updatedAt of the previous one.
createdAt: arr[(index + 1) % arr.length].updatedAt,
text: noteEdit.text,
cw: noteEdit.cw,
_shouldInsertAd_: false,
files: noteEdit.files,
fileIds: noteEdit.fileIds,
emojis: note.value.emojis.concat(noteEdit.emojis),
});
return [now].concat(noteEdits).map((noteEdit: NoteEdit, index, arr): Note => {
return Object.assign({}, note.value, {
historyId: noteEdit.id,
// Conversion from updatedAt to createdAt
// The createdAt of a edition's content is actually the updatedAt of the previous one.
createdAt: arr[(index + 1) % arr.length].updatedAt,
text: noteEdit.text,
cw: noteEdit.cw,
_shouldInsertAd_: false,
files: noteEdit.files,
fileIds: noteEdit.fileIds,
emojis: note.value.emojis.concat(noteEdit.emojis),
});
});
}
</script>