aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-02-21 23:07:49 +0800
committerMistivia <i@mistivia.com>2025-02-21 23:07:49 +0800
commit3f63e7dbdce27527adfe1c62f6849b63a56626db (patch)
tree4998ea0b473b222a122e3371ef2dc26345afff66
parenta13b2290833f635453622ed330cc3895950ffcdb (diff)
fix init bug
-rw-r--r--src/deck.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/deck.js b/src/deck.js
index 7812128..be757bc 100644
--- a/src/deck.js
+++ b/src/deck.js
@@ -129,15 +129,14 @@ function initDeck() {
return;
}
}
- let cachedFormat = localStorage.getItem('format');
- if (cachedFormat !== null) {
- setFormat(cachedFormat);
- }
let cachedDeck = localStorage.getItem('cachedDeck');
if (cachedDeck !== null) {
cachedDeck = JSON.parse(cachedDeck);
setDeck(cachedDeck)
- return;
+ }
+ let cachedFormat = localStorage.getItem('format');
+ if (cachedFormat !== null) {
+ setFormat(cachedFormat);
}
}