mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2024-11-25 08:16:28 +01:00
Fix wish ordering
This commit is contained in:
parent
4bc8cdd68a
commit
781ec913f2
2 changed files with 11 additions and 5 deletions
|
@ -347,10 +347,7 @@
|
|||
const importedWishes = wishes[code].slice().reverse();
|
||||
const oldestWish = importedWishes[0];
|
||||
|
||||
localWishes = localWishes
|
||||
.slice()
|
||||
.filter((e) => e.time < oldestWish.time)
|
||||
.sort((a, b) => a.time - b.time);
|
||||
localWishes = localWishes.slice().filter((e) => e.time < oldestWish.time);
|
||||
|
||||
const combined = [...localWishes, ...importedWishes];
|
||||
|
||||
|
|
|
@ -99,7 +99,16 @@
|
|||
}
|
||||
|
||||
function addPullDetail(newPull) {
|
||||
pulls = [...pulls, newPull];
|
||||
let index = -1;
|
||||
for (let i = pulls.length - 1; i >= 0; i--) {
|
||||
if (newPull.time >= pulls[i].time) {
|
||||
index = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const lastPulls = [...pulls];
|
||||
lastPulls.splice(index, 0, newPull);
|
||||
pulls = lastPulls;
|
||||
closeModal();
|
||||
saveData();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue