Skip to content

Commit 3168c45

Browse files
committed
fix: load all cards from cache
1 parent edcb3c7 commit 3168c45

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

changelog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# UnderScript Changelog
22

3-
## Version 0.57.2 (2024-04-06)
3+
## Version 0.57.2 (2024-04-10)
44
1. Fixed display bug with cosmetic confirmation purchases
5+
1. Fixed bug loading all cards
6+
1. Fixed bug loading plugin styles
57

68
## Version 0.57.1 (2024-04-06)
79
1. Made filtered buttons dimmer

src/hooks/allCardsReady.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ eventManager.on(':loaded', () => {
88
const allCards = global('allCards', {
99
throws: false,
1010
});
11-
if (!allCards || !allCards.length) {
11+
if (!allCards) {
12+
const cached = localStorage.getItem('allCards');
13+
if (!cached) return;
14+
const parsed = JSON.parse(cached);
15+
window.allCards = parsed;
16+
call(parsed);
17+
} else if (!allCards.length) {
1218
document.addEventListener('allCardsReady', () => call(global('allCards')));
1319
} else {
1420
call(allCards);

0 commit comments

Comments
 (0)