Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Handle refresh dimension failure post qbo connection (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwin1111 authored Jan 10, 2024
1 parent 7d03dfa commit cbdac61
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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));
Expand Down

0 comments on commit cbdac61

Please sign in to comment.