jichoi / lms_front star
박민혁 박민혁 2024-08-23
240823 박민혁 스토어 수정
@69c5fd4c429e8590f4b3d9d0a88ca59e186083cd
client/views/pages/AppStore.js
--- client/views/pages/AppStore.js
+++ client/views/pages/AppStore.js
@@ -93,7 +93,7 @@
         setToken(state, token) {
             state.token = token;
         },
-        clearToken(state) {
+        clearState(state) {
             state.token = null;
             state.userId = null;
             state.userNm = null;
@@ -102,18 +102,21 @@
             state.schdlId = null;
             state.bookId = null;
             state.unitId = null;
+            state.textId = null;
             state.learningId = null;
-            saveStateToLocalStorage(state);
+
+            state.currentLearningIds = [];
+            state.prblmTypeId = null;
+            state.currentLabel = null;
+            state.currentProblemIndex = null;
+            state.allProblems = [];
+            state.allAnswers = [];
+            state.wdBookIdList = [],
+            state.currentWdBkIndex = 0;
+            seqNum = null;
+            saveStateToLocalStorage(state);        
         },
 
-        clearState(state) {
-            const initialState = loadStateFromLocalStorage(); // 초기 상태 로드
-            Object.keys(initialState).forEach(key => {
-                state[key] = initialState[key];
-            });
-            saveStateToLocalStorage(state); // 초기화된 상태 저장
-        },
-    
         setUser(state, userId) {
             state.userId = userId;
             saveStateToLocalStorage(state);
Add a comment
List