mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-26 18:58:21 +02:00
All: Reducer should not mutate state
This commit is contained in:
parent
20482b2f14
commit
87ccb86f54
@ -467,14 +467,14 @@ function handleHistory(state, action) {
|
||||
|
||||
backwardHistoryNotes = backwardHistoryNotes.map(note => {
|
||||
if (note.id === modNote.id) {
|
||||
return Object.assign(note, { parent_id: modNote.parent_id, selectedFolderId: modNote.parent_id });
|
||||
return Object.assign({}, note, { parent_id: modNote.parent_id, selectedFolderId: modNote.parent_id });
|
||||
}
|
||||
return note;
|
||||
});
|
||||
|
||||
forwardHistoryNotes = forwardHistoryNotes.map(note => {
|
||||
if (note.id === modNote.id) {
|
||||
return Object.assign(note, { parent_id: modNote.parent_id, selectedFolderId: modNote.parent_id });
|
||||
return Object.assign({}, note, { parent_id: modNote.parent_id, selectedFolderId: modNote.parent_id });
|
||||
}
|
||||
return note;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user