Commit 4a4fb16c authored by Sophia's avatar Sophia

fixed a bug that mutates date value of lflist array item

parent 13923e5e
......@@ -43,7 +43,7 @@ function uploadResult(room) {
}
room.finishedAt.push(moment());
const data = {
roomSettings: Object.assign(Object.assign({}, room.hostinfo), { lflist: Object.assign(Object.assign({}, lflists[room.hostinfo.lflist]), { date: lflists[room.hostinfo.lflist].date.add(1, "day").format("YYYY.MM") }) }),
roomSettings: Object.assign(Object.assign({}, room.hostinfo), { lflist: Object.assign(Object.assign({}, lflists[room.hostinfo.lflist]), { date: lflists[room.hostinfo.lflist].date.clone().add(1, "day").format("YYYY.MM") }) }),
players: room.customPlayerInformation || [],
startedAt: room.startedAt ? room.startedAt.map(formatTime) : [],
finishedAt: room.finishedAt ? room.finishedAt.map(formatTime) : [],
......
......@@ -126,7 +126,7 @@ function uploadResult(room: typeof ROOM_all[0]) {
...room.hostinfo,
lflist: {
...lflists[room.hostinfo.lflist],
date: lflists[room.hostinfo.lflist].date.add(1, "day").format("YYYY.MM"),
date: lflists[room.hostinfo.lflist].date.clone().add(1, "day").format("YYYY.MM"),
},
},
players: room.customPlayerInformation || [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment