From cbdac6174669ef072e386b18ea9895b4487d8c21 Mon Sep 17 00:00:00 2001 From: Ashwin Thanaraj <37061471+ashwin1111@users.noreply.github.com> Date: Wed, 10 Jan 2024 13:40:28 +0530 Subject: [PATCH] Handle refresh dimension failure post qbo connection (#315) --- .../qbo-connector/qbo-connector.component.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/shared/components/configuration/qbo-connector/qbo-connector.component.ts b/src/app/shared/components/configuration/qbo-connector/qbo-connector.component.ts index 745c0e04..5b60dc54 100644 --- a/src/app/shared/components/configuration/qbo-connector/qbo-connector.component.ts +++ b/src/app/shared/components/configuration/qbo-connector/qbo-connector.component.ts @@ -172,6 +172,14 @@ export class QboConnectorComponent implements OnInit, OnDestroy { }); } + private setupPostConnectionStates(qboCredentials: QBOCredentials): void { + this.trackingService.onOnboardingStepCompletion(OnboardingStep.CONNECT_QBO, 1); + this.workspaceService.setOnboardingState(OnboardingState.MAP_EMPLOYEES); + this.qboConnectionInProgress = false; + this.qboCompanyName = qboCredentials.company_name; + this.showOrHideDisconnectQBO(); + } + private postQboCredentials(code: string, realmId: string): void { const qboAuthResponse: QboConnectorPost = { code: code, @@ -181,11 +189,9 @@ export class QboConnectorComponent implements OnInit, OnDestroy { this.qboConnectorService.connectQBO(qboAuthResponse).subscribe((qboCredentials: QBOCredentials) => { this.workspaceService.refreshQBODimensions().subscribe(() => { - this.trackingService.onOnboardingStepCompletion(OnboardingStep.CONNECT_QBO, 1); - this.workspaceService.setOnboardingState(OnboardingState.MAP_EMPLOYEES); - this.qboConnectionInProgress = false; - this.qboCompanyName = qboCredentials.company_name; - this.showOrHideDisconnectQBO(); + this.setupPostConnectionStates(qboCredentials); + }, () => { + this.setupPostConnectionStates(qboCredentials); }); }, (error) => { console.error('QBO Connection', JSON.stringify(error));