From 679da26e0b7689a7381c9a38f2fd8544dfb1a1a8 Mon Sep 17 00:00:00 2001 From: Rotem Hen Date: Thu, 14 Sep 2023 14:36:19 +0300 Subject: [PATCH] adjust use of refreshGraphQL to recent changes --- .../main/default/lwc/mainDashboard/mainDashboard.js | 7 +++---- .../main/default/lwc/summaryComponent/summaryComponent.js | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/MobileDashboard/force-app/main/default/lwc/mainDashboard/mainDashboard.js b/MobileDashboard/force-app/main/default/lwc/mainDashboard/mainDashboard.js index cbf0bb5..fe82ec7 100644 --- a/MobileDashboard/force-app/main/default/lwc/mainDashboard/mainDashboard.js +++ b/MobileDashboard/force-app/main/default/lwc/mainDashboard/mainDashboard.js @@ -21,13 +21,12 @@ export default class MainDashboard extends LightningElement { this.queryResult = result; const { data, errors } = result; if (data) { + const allSettings = data?.uiapi?.query['Mobile_Dashboard_Setting__c']?.edges; + if (allSettings) this.populateDashboardSettings(allSettings); if (!this.refreshed) { - this.refreshGraphQL(); this.refreshed = true; - return; + this.refreshGraphQL(); } - const allSettings = data?.uiapi?.query['Mobile_Dashboard_Setting__c']?.edges; - if (allSettings) this.populateDashboardSettings(allSettings); } if (errors) { console.log(JSON.stringify(errors)); diff --git a/MobileDashboard/force-app/main/default/lwc/summaryComponent/summaryComponent.js b/MobileDashboard/force-app/main/default/lwc/summaryComponent/summaryComponent.js index c5d3b8a..5a1aa23 100644 --- a/MobileDashboard/force-app/main/default/lwc/summaryComponent/summaryComponent.js +++ b/MobileDashboard/force-app/main/default/lwc/summaryComponent/summaryComponent.js @@ -34,12 +34,11 @@ export default class SummaryComponent extends LightningElement { this.queryResult = result; const { data, errors } = result; if (data) { + this.setRecordsAndSubQueries(data); if (!this.refreshed) { - this.refreshGraphQL(); this.refreshed = true; - return; + this.refreshGraphQL(); } - this.setRecordsAndSubQueries(data); } if (errors) { console.log(errors);