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 importedWishes = wishes[code].slice().reverse();
|
||||||
const oldestWish = importedWishes[0];
|
const oldestWish = importedWishes[0];
|
||||||
|
|
||||||
localWishes = localWishes
|
localWishes = localWishes.slice().filter((e) => e.time < oldestWish.time);
|
||||||
.slice()
|
|
||||||
.filter((e) => e.time < oldestWish.time)
|
|
||||||
.sort((a, b) => a.time - b.time);
|
|
||||||
|
|
||||||
const combined = [...localWishes, ...importedWishes];
|
const combined = [...localWishes, ...importedWishes];
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function addPullDetail(newPull) {
|
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();
|
closeModal();
|
||||||
saveData();
|
saveData();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue