Просмотр исходного кода

fix: add detectChanges after loadApig to render data from async fetch

gangvy 5 месяцев назад
Родитель
Сommit
87471a734a
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      src/app/app.ts

+ 3 - 0
src/app/app.ts

@@ -217,10 +217,12 @@ export class App implements OnInit {
 
       // 1. Try getApig REST endpoint
       const resp = await this.postJSON(API_BASE + '/api/apig/getApig', { authid: this.authId });
+      console.log('[getApig] response:', JSON.stringify(resp).substring(0, 500));
       if (resp.code === 200 && resp.data) {
         this.apig = resp.data;
         this.applyTestTier();
         this.selectTier(0);
+        this.cdr.detectChanges();
         this.loadOrderHistory();
         return;
       }
@@ -237,6 +239,7 @@ export class App implements OnInit {
             this.apig = cfData;
             this.applyTestTier();
             this.selectTier(0);
+            this.cdr.detectChanges();
             this.loadOrderHistory();
             return;
           }