buildingproduct-library 4.0.9 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -812,7 +812,7 @@ class AccountDropdownComponent {
812
812
  }
813
813
  });
814
814
  this.showWaitCursor.next(false);
815
- if (localStorage.getItem('branchDetails') === null) {
815
+ if (this.isNullOrEmpty(localStorage.getItem('branchDetails'))) {
816
816
  localStorage.setItem('branchDetails', JSON.stringify(this.selecteduserData.branchPOS));
817
817
  }
818
818
  if (this.selecteduserData.isDefaultAccount == true) {
@@ -823,13 +823,17 @@ class AccountDropdownComponent {
823
823
  localStorage.setItem('selectedAccout', JSON.stringify(selectedAccount));
824
824
  }
825
825
  this.findStoreService.homeBranchApi(this.selecteduserData.branchPOS);
826
- if (localStorage.getItem('branchDetails') === null) {
826
+ if (this.isNullOrEmpty(localStorage.getItem('branchDetails'))) {
827
827
  localStorage.setItem('branchDetails', JSON.stringify(this.selecteduserData.branchPOS));
828
828
  }
829
829
  }
830
830
  this.findStoreService.homeBranchApi(this.selecteduserData.branchPOS);
831
831
  }
832
832
  }
833
+ // Check if any value is empty or undefined
834
+ isNullOrEmpty(value) {
835
+ return value == null || value == undefined || value == '' || value == ' ';
836
+ }
833
837
  getAccountName(data) {
834
838
  const selectedAccount = {
835
839
  uid: data.uid