ngx-techlify-core 11.4.5-beta.2 → 11.4.5-beta.3

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.
@@ -884,9 +884,8 @@
884
884
  * @since 20171202
885
885
  */
886
886
  var ErrorHandlerService = /** @class */ (function () {
887
- function ErrorHandlerService(alerter, config) {
887
+ function ErrorHandlerService(alerter) {
888
888
  this.alerter = alerter;
889
- this.config = config;
890
889
  }
891
890
  ErrorHandlerService.prototype.handleError = function (errorResponse, msg) {
892
891
  if (msg === void 0) { msg = ''; }
@@ -914,23 +913,17 @@
914
913
  }
915
914
  var errMessage = errors.length ? errors[0] : msg;
916
915
  this.alerter.addAlert("Error: " + errMessage, "warning");
917
- if (errorResponse.status == 403 && this.config.isLogoutWhileApiGetsFailed) {
918
- sessionStorage.clear();
919
- localStorage.clear();
920
- location.reload();
921
- }
922
916
  };
923
917
  return ErrorHandlerService;
924
918
  }());
925
- ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService), i0.ɵɵinject(TechlifyConfig)); }, token: ErrorHandlerService, providedIn: "root" });
919
+ ErrorHandlerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ErrorHandlerService_Factory() { return new ErrorHandlerService(i0.ɵɵinject(AlertService)); }, token: ErrorHandlerService, providedIn: "root" });
926
920
  ErrorHandlerService.decorators = [
927
921
  { type: i0.Injectable, args: [{
928
922
  providedIn: 'root'
929
923
  },] }
930
924
  ];
931
925
  ErrorHandlerService.ctorParameters = function () { return [
932
- { type: AlertService },
933
- { type: TechlifyConfig }
926
+ { type: AlertService }
934
927
  ]; };
935
928
 
936
929
  var log = new Logger('ErrorHandlerInterceptor');
@@ -948,7 +941,7 @@
948
941
  };
949
942
  // Customize the default error handler here if needed
950
943
  ErrorHandlerInterceptor.prototype.handleError = function (error) {
951
- var _a, _b;
944
+ var _a, _b, _c;
952
945
  var errorMessage = '';
953
946
  if (error.error instanceof ErrorEvent) {
954
947
  // client-side error
@@ -958,6 +951,11 @@
958
951
  // server-side error
959
952
  errorMessage = "Server Error: " + ((_b = this.configService) === null || _b === void 0 ? void 0 : _b.getProjectKey());
960
953
  try {
954
+ if (error.status == 403 && ((_c = this.configService.getConfigsRaw()) === null || _c === void 0 ? void 0 : _c.isLogoutWhileApiGetsFailed)) {
955
+ sessionStorage.clear();
956
+ localStorage.clear();
957
+ location.reload();
958
+ }
961
959
  this.errorHandler.handleError(error, 'Unexpected Server Error, try later or contact service team');
962
960
  }
963
961
  catch (e) {