Browse Source

fix(frontend): wisdom index radar chart - loadCognitiveReport race condition

loadChildren() is async (.then callback) but loadCognitiveReport() was
called immediately after in onShow, before activeChildId was set.
Result: activeChildId was still null → loadCognitiveReport returned
early → cognitiveReport stayed null → radar chart v-if never rendered.

Fix: call loadCognitiveReport() inside loadChildren's .then callback,
after activeChildId is confirmed set (from storage or default to first child).
Xiaogang Liao 2 months ago
parent
commit
899455b05c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      cfc-frontend/pages/wisdom/index.vue

+ 2 - 0
cfc-frontend/pages/wisdom/index.vue

@@ -304,6 +304,8 @@ export default {
               uni.setStorageSync('currentChildId', self.activeChildId)
             }
           }
+          // Load cognitive report AFTER activeChildId is confirmed set
+          self.loadCognitiveReport()
         }
       }).catch(function(e) {})
     },