Skip to content

Commit ed231b6

Browse files
authored
fix: may referernce out of bound index in clearDuplicatedHistory
1 parent 3b1e270 commit ed231b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

public/js/history.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function clearDuplicatedHistory (notehistory) {
5959
const newId = newnotehistory[j].id.replace(/=+$/, '')
6060
if (id === newId || notehistory[i].id === newnotehistory[j].id || !notehistory[i].id || !newnotehistory[j].id) {
6161
const time = (typeof notehistory[i].time === 'number' ? moment(notehistory[i].time) : moment(notehistory[i].time, 'MMMM Do YYYY, h:mm:ss a'))
62-
const newTime = (typeof newnotehistory[i].time === 'number' ? moment(newnotehistory[i].time) : moment(newnotehistory[i].time, 'MMMM Do YYYY, h:mm:ss a'))
62+
const newTime = (typeof newnotehistory[j].time === 'number' ? moment(newnotehistory[j].time) : moment(newnotehistory[j].time, 'MMMM Do YYYY, h:mm:ss a'))
6363
if (time >= newTime) {
6464
newnotehistory[j] = notehistory[i]
6565
}

0 commit comments

Comments
 (0)