@sumaris-net/ngx-components 2.0.4 → 2.0.6

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.
@@ -15572,7 +15572,7 @@ class GraphqlService extends StartableService {
15572
15572
  get defaultFetchPolicy() {
15573
15573
  return this._defaultFetchPolicy;
15574
15574
  }
15575
- setAuthToken(token) {
15575
+ async setAuthToken(token) {
15576
15576
  if (token) {
15577
15577
  console.debug('[graphql] Apply token authentication to headers');
15578
15578
  this.connectionParams.authToken = token;
@@ -15581,11 +15581,16 @@ class GraphqlService extends StartableService {
15581
15581
  else if (this.connectionParams.authToken) {
15582
15582
  console.debug('[graphql] Remove token authentication from headers');
15583
15583
  delete this.connectionParams.authToken;
15584
- // Clear cache
15585
- this.clearCache();
15584
+ // Restart, to force client re-creation, and websocket to logout
15585
+ if (this.started) {
15586
+ await this.restart();
15587
+ }
15588
+ else {
15589
+ await this.clearCache();
15590
+ }
15586
15591
  }
15587
15592
  }
15588
- setAuthBasic(basic) {
15593
+ async setAuthBasic(basic) {
15589
15594
  if (basic) {
15590
15595
  console.debug('[graphql] Apply basic authentication to headers');
15591
15596
  this.connectionParams.authBasic = basic;
@@ -15594,8 +15599,13 @@ class GraphqlService extends StartableService {
15594
15599
  else if (this.connectionParams.authBasic) {
15595
15600
  console.debug('[graphql] Remove basic authentication from headers');
15596
15601
  delete this.connectionParams.authBasic;
15597
- // Clear cache
15598
- this.clearCache();
15602
+ // Restart, to force client re-creation, and websocket to logout
15603
+ if (this.started) {
15604
+ await this.restart();
15605
+ }
15606
+ else {
15607
+ await this.clearCache();
15608
+ }
15599
15609
  }
15600
15610
  }
15601
15611
  /**
@@ -28583,7 +28593,8 @@ const SocialErrorCodes = {
28583
28593
  COUNT_USER_EVENT_ERROR: 50002,
28584
28594
  SEND_MESSAGE_ERROR: 50003,
28585
28595
  SUBSCRIBE_USER_EVENTS_ERROR: 50005,
28586
- SUBSCRIBE_JOB_PROGRESSION_ERROR: 50010
28596
+ SUBSCRIBE_JOB_PROGRESSION_ERROR: 50010,
28597
+ LOAD_JOB_PROGRESSIONS_ERROR: 50011
28587
28598
  };
28588
28599
 
28589
28600
  const APP_USER_EVENT_SERVICE = new InjectionToken('UserEventService');