From 3f63e7dbdce27527adfe1c62f6849b63a56626db Mon Sep 17 00:00:00 2001
From: Mistivia <i@mistivia.com>
Date: Fri, 21 Feb 2025 23:07:49 +0800
Subject: fix init bug

---
 src/deck.js | 9 ++++-----
 1 file 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);
     }
 }
 
-- 
cgit v1.0

