Skip to content

Commit

Permalink
Fix business central reload issue (#630)
Browse files Browse the repository at this point in the history
* Fix business central reload issue

* fix
  • Loading branch information
ashwin1111 authored Mar 6, 2024
1 parent 0736f10 commit 2b3dedb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/app/core/guard/business-central-token.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { BusinessCentralConnectorService } from '../services/business-central/bu
import { IntegrationsToastService } from '../services/common/integrations-toast.service';
import { WorkspaceService } from '../services/common/workspace.service';
import { globalCacheBusterNotifier } from 'ts-cacheable';
import { BusinessCentralOnboardingState, ToastSeverity } from '../models/enum/enum.model';
import { AppUrl, BusinessCentralOnboardingState, ToastSeverity } from '../models/enum/enum.model';
import { HelperService } from '../services/common/helper.service';

@Injectable({
providedIn: 'root'
Expand All @@ -14,6 +15,7 @@ export class BusinessCentralTokenGuard implements CanActivate {

constructor(
private businessCentralConnectorService: BusinessCentralConnectorService,
private helperService: HelperService,
private router: Router,
private toastService: IntegrationsToastService,
private workspaceService: WorkspaceService
Expand All @@ -22,6 +24,7 @@ export class BusinessCentralTokenGuard implements CanActivate {
canActivate(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
this.helperService.setBaseApiURL(AppUrl.BUSINESS_CENTRAL);
const workspaceId = this.workspaceService.getWorkspaceId();

if (!workspaceId) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<router-outlet></router-outlet>
<router-outlet *ngIf="!isLoading"></router-outlet>

0 comments on commit 2b3dedb

Please sign in to comment.