ngOnInit(): void {
        this.featureInventoryProductsTableEnabled = checkFeatureFlag(SubstanceFeatureFlag.LIST_INVENTORY_MODE);
        this.isShowLoading = true;
        this.localeString = this.cookieHelper.getStore('languageCulture');
        this._listeningEvent();
        this._checkPermission();
        this._getCompanyProfile();
        this.checkDevice();

        this.globalService.subUserProfile().pipe(takeUntil(this.ngUnsubscribe)).subscribe(userProfile => {
            this.userId = userProfile.id?.toString();

            const lastViewModeMobile = localStorage.getItem(`${this.userId}${Constants.localStorageKey.LAST_VIEW_MODE_MOBILE_SUBSTANCE_INDEX}`);
            if (lastViewModeMobile) {
                this.selectedViewMode = this.listViewMode.find(item => item.id === +lastViewModeMobile);
            }

            this.route.params.pipe(takeUntil(this.ngUnsubscribe)).subscribe(async params => {
                if (environment.server.isAnonymous && StringHelper.isValidGUID(params['locationId'])) {
                    await this.globalService.subLocations(true, true, [params['locationId']]);
                }

                this.isShowLoading = true;
                this.isChangingLocation = true;

                this.inputSearch.pageIndex = this.substancePageIndex = 0;
                this.setPaginator(0);
                console.log(params, 'params');


                if (StringHelper.isValidGUID(params['locationId']) && params['locationId'] !== this.allText) {
                    this.locationId = params['locationId'];
                    console.log(this.locationId, 'locationId 111');
                    this.inputSearch.locationIds = [];
                    this.inputSearch.locationId = this.locationId;
                    this.globalService.submitActiveLocation(this.locationId);
                    this.globalService.setLocationIdToLocalStorage(this.locationId);

                    this.globalService.locationList$.pipe(takeUntil(this.ngUnsubscribe)).subscribe(allLocation => {
                        if (!this.checkLocationExisted(allLocation)) {
                            this.router.navigate([this.isAnonymous ? '/not-permission' : '/substance/all']);
                            return;
                        }
                        console.log(this.locationId, params, 'locationId');
                        this.globalService.getLocationByIdNotIncludeChemicals(this.locationId, true).pipe(takeUntil(this.ngUnsubscribe)).subscribe((locationDetail) => {
                            if (!locationDetail) {
                                return;
                            }

                            locationDetail.locationAttribute = locationDetail.locationAttribute || [];
                            this.locationDetail = locationDetail;
                            console.log(this.locationDetail, 'locationDetail');

                            const lastActivedTab = localStorage.getItem(`${this.userId}${Constants.localStorageKey.LAST_ACTIVED_TAB}`);

                            if (this.isShowWATab) {
                                const request: GetCountWorkAssignmentInLocationRequest = new GetCountWorkAssignmentInLocationRequest();
                                request.locationId = this.locationId;
                                this.waService.getCountWorkAssignmentInLocation(request).pipe(takeUntil(this.ngUnsubscribe)).subscribe((result) => {
                                    this.isDisableWATab = !result;

                                    if (lastActivedTab) {
                                        this.activeTab = this.isDisableWATab ? this.activeSubstanceTab.id : +lastActivedTab;
                                    }
                                });
                            }
                            else {
                                this.activeTab = lastActivedTab ? +lastActivedTab : this.activeSubstanceTab.id;
                            }

                            combineLatest(
                                this.globalService.locationList$,
                                this.globalService.echa_substances$,
                                this.globalService.getChemicalDBConfigurationByNames([Constants.ExpiredSubstance, Constants.ConflictSubstanceWithSubstance, Constants.CheckMixturesChemicals]),
                            ).pipe(takeUntil(this.ngUnsubscribe)).subscribe(async ([allLocation, substanceFromECHAPIC, configs]) => {
                                this.allLocation = allLocation;

                                this.listSubstanceFromECHAPIC = substanceFromECHAPIC;
                                this.configExpiresYear = configs.find(config => config.name === Constants.ExpiredSubstance);
                                this.showConflictChemicalAndChemical = configs.find(config => config.name === Constants.ConflictSubstanceWithSubstance)?.status;
                                this.isCheckMixturesChemical = configs.find(config => config.name === Constants.CheckMixturesChemicals)?.status;

                                if (this.locationDetail && this.allLocation.filter(x => x.id == this.locationDetail?.id).length > 0) {
                                    this._initBreadcrumbData();
                                }
                            }, (error) => {
                                console.error(error);
                            });

                        }, (error) => {
                            console.error(error);
                        });
                    });

                } else if (params['locationId'] !== this.allText) {
                    this.router.navigate([this.isAnonymous ? '/not-permission' : '/substance/all']);
                    return;
                } else {
                    this.locationId = null;
                    this.locationDetail = null;
                    this.inputSearch.locationId = null;

                    combineLatest(
                        this.globalService.locationList$,
                        this.globalService.echa_substances$,
                        this.globalService.getChemicalDBConfigurationByNames([Constants.ExpiredSubstance, Constants.ConflictSubstanceWithSubstance, Constants.CheckMixturesChemicals]),
                    ).pipe(takeUntil(this.ngUnsubscribe)).subscribe(async ([allLocation, substanceFromECHAPIC, configs]) => {
                        this.allLocation = allLocation;

                        this.listSubstanceFromECHAPIC = substanceFromECHAPIC;
                        this.configExpiresYear = configs.find(config => config.name === Constants.ExpiredSubstance);
                        this.showConflictChemicalAndChemical = configs.find(config => config.name === Constants.ConflictSubstanceWithSubstance)?.status;
                        this.isCheckMixturesChemical = configs.find(config => config.name === Constants.CheckMixturesChemicals)?.status;

                        if (this.locationDetail && this.allLocation.filter(x => x.id == this.locationDetail?.id).length > 0) {
                            this._initBreadcrumbData();
                        }
                    }, (error) => {
                        console.error(error);
                    });
                }

            }, (error) => {
                console.error(error);
            });
        });

        if (this.featureInventoryProductsTableEnabled) {
            this.loadFontFamily();
        }

    }

when i click to other detail from '9cb9dc94-2709-46a6-a8c2-de82e402652d' to '821490e7-bab1-49f5-acd4-1c2b3a58f28d'
it has issue, why '9cb9dc94-2709-46a6-a8c2-de82e402652d' is called first
9cb9dc94-2709-46a6-a8c2-de82e402652d {locationId: '9cb9dc94-2709-46a6-a8c2-de82e402652d'} locationId
{locationId: '821490e7-bab1-49f5-acd4-1c2b3a58f28d'} 'params'
821490e7-bab1-49f5-acd4-1c2b3a58f28d locationId 111
821490e7-bab1-49f5-acd4-1c2b3a58f28d {locationId: '821490e7-bab1-49f5-acd4-1c2b3a58f28d'} locationId

if i try to setTimout({this.globalService.getLocationByIdNotIncludeChemi...}, 100), this is working