@chat21/chat21-ionic 3.0.59-rc7 → 3.0.59-rc9

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.59-rc9
4
+ - Changes in the archived conversations the date format if the browser language is English
5
+ - Displays the button to open the contact list for direct conversations and the entry at the top of the conversation list showing the number of unassigned conversations for a selected project if the "supportMode" configuration property is set to true
6
+ - Adds a style rule on the unassigned conversations page that changes the background of the "ion-content" if the project list is displayed in the iframe
7
+ - Adds "supportMode" property to env.sample, chat-config-template.json and chat-config.json
8
+
9
+ ### 3.0.59-rc8
10
+ - Changes the title of the modal window showing unassigned conversations from "Unassigned Conversations" to "New Conversations"
11
+ - Fixes the bug: if the "chatEngine" property value is set to "mqtt" the login modal window does not disappear even if the agent is logged in
12
+ - Fixed the value of the configuration property "dashboardUrl"
13
+
3
14
  ### 3.0.59-rc7
4
15
  - Fixes the bug "Cannot read properties of undefined (reading 'get')" in component template showing the number of new conversations
5
16
  - Fixes the bug: the value of the "supportMode" property is passed hard-coded
package/env.sample CHANGED
@@ -10,6 +10,7 @@ PUSH_ENGINE=none
10
10
  FILE_UPLOAD_ACCEPT=*/*
11
11
  TENANT=tilechat
12
12
  LOG_LEVEL=INFO
13
+ SUPPORT_MODE=false
13
14
 
14
15
  # For MQTT Chat Engine
15
16
  MQTT_APPID=tilechat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
- "version": "3.0.59-rc7",
3
+ "version": "3.0.59-rc9",
4
4
  "author": "Tiledesk SRL",
5
5
  "homepage": "https://ionicframework.com/",
6
6
  "scripts": {
@@ -134,14 +134,12 @@
134
134
 
135
135
  <div item-end *ngIf="conversation?.archived" class="achived-icon-wpr">
136
136
  <span *ngIf="(conversation.timestamp | amDateFormat:'YYYY') === currentYear" class="time-in-archived">
137
- {{browserLang === 'it' ? (conversation.timestamp| amDateFormat:'DD MMM') : (conversation.timestamp |
138
- amDateFormat:'MMM DD')}}
137
+ {{browserLang === 'en' ? (conversation.timestamp | amDateFormat:'MMM DD') : (conversation.timestamp| amDateFormat:'DD MMM')}}
139
138
 
140
139
  <!-- {{conversation.timestamp | amDateFormat:'DD MMM'}} -->
141
140
  </span>
142
141
  <span *ngIf="(conversation.timestamp | amDateFormat:'YYYY') !== currentYear" class="time-in-archived">
143
- {{browserLang === 'it' ? (conversation.timestamp| amDateFormat:'DD MMM') : (conversation.timestamp |
144
- amDateFormat:'MMM DD YYYY')}}
142
+ {{browserLang === 'en' ? (conversation.timestamp | amDateFormat:'MMM DD YYYY') : (conversation.timestamp| amDateFormat:'DD MMM YYYY') }}
145
143
  <!-- {{conversation.timestamp | amDateFormat:'DD MMM YYYY'}} -->
146
144
  </span>
147
145
  <i class="material-icons" item-end style="font-size: 15px;font-weight: 400;color: #666666;"> history </i>
@@ -14,7 +14,7 @@
14
14
 
15
15
  <ion-buttons slot="end">
16
16
 
17
- <ion-button *ngIf="!supportMode" ion-button fill="clear" (click)="onOpenContactsDirectory($event)">
17
+ <ion-button *ngIf="supportMode" ion-button fill="clear" (click)="onOpenContactsDirectory($event)">
18
18
  <ion-icon slot="icon-only" name="create-outline"></ion-icon>
19
19
  </ion-button>
20
20
 
@@ -15,7 +15,7 @@ export class DdpHeaderComponent implements OnInit {
15
15
  ) { }
16
16
 
17
17
  ngOnInit() {
18
- console.log('DDP HEADER SUPPORT MODE ', this.supportMode)
18
+ // console.log('DDP HEADER SUPPORT MODE ', this.supportMode)
19
19
  }
20
20
 
21
21
  // START @Output() //
@@ -87,7 +87,7 @@
87
87
  tabindex="0" [checked]="project?.ws_projct_user_available">
88
88
  <label class="onoffswitch-label" for="myonoffswitch"></label>
89
89
  </div> -->
90
- <div class="availabily---wpr" style=" ">
90
+ <div class="availabily---wpr">
91
91
  <!-- <div class="i_onoffswitch"
92
92
  (click)="$event.stopPropagation();changeAvailabilityState(project?.id_project?._id, project?.ws_projct_user_available)">
93
93
  <input type="checkbox" name="i_onoffswitch" class="i_onoffswitch-checkbox"
@@ -96,31 +96,42 @@
96
96
  </div> -->
97
97
 
98
98
 
99
- <div class="onoffswitch" (click)="$event.stopPropagation();changeAvailabilityState(project?.id_project?._id, project?.ws_projct_user_available)">
100
- <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" tabindex="0" [checked]="project?.ws_projct_user_available">
99
+ <div class="onoffswitch"
100
+ (click)="$event.stopPropagation();changeAvailabilityState(project?.id_project?._id, project?.ws_projct_user_available)">
101
+ <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch"
102
+ tabindex="0" [checked]="project?.ws_projct_user_available">
101
103
  <label class="onoffswitch-label" for="myonoffswitch"></label>
104
+ </div>
102
105
  </div>
103
- </div>
104
-
105
106
 
107
+ <!-- (click)="$event.stopPropagation();changeAvailabilityState(project?.id_project?._id, project?.ws_projct_user_available)" -->
106
108
  <span *ngIf="project?.ws_projct_user_available === true" class="availibility-status-text"
107
- [ngClass]="{'online-text-color' : project?.ws_projct_user_available === true, 'offline-text-color' : project?.ws_projct_user_available === false}"
108
- (click)="$event.stopPropagation();changeAvailabilityState(project?.id_project?._id, project?.ws_projct_user_available)">
109
+ [ngClass]="{'online-text-color' : project?.ws_projct_user_available === true, 'offline-text-color' : project?.ws_projct_user_available === false}">
109
110
  {{translationMap?.get('Available') }}
110
111
  </span>
112
+ <!-- (click)="$event.stopPropagation();changeAvailabilityState(project?.id_project?._id, project?.ws_projct_user_available)" -->
111
113
  <span *ngIf="project?.ws_projct_user_available === false" class="availibility-status-text"
112
- [ngClass]="{'online-text-color' : project?.ws_projct_user_available === true, 'offline-text-color' : project?.ws_projct_user_available === false}"
113
- (click)="$event.stopPropagation();changeAvailabilityState(project?.id_project?._id, project?.ws_projct_user_available)">
114
+ [ngClass]="{'online-text-color' : project?.ws_projct_user_available === true, 'offline-text-color' : project?.ws_projct_user_available === false}">
114
115
  {{translationMap?.get('Unavailable')}}
115
116
  </span>
116
117
  <div class="project-item--isBusy-icon-wpr" *ngIf="project?.ws_projct_user_isBusy === true">
117
- <span class="material-icons project-item--isBusy-icon">
118
+ <!-- <span class="material-icons project-item--isBusy-icon">
118
119
  access_time
119
- </span>
120
+ </span> -->
121
+ <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="16px"
122
+ viewBox="0 0 24 24" width="16px" fill="#FEB92C">
123
+ <g>
124
+ <path d="M0,0h24v24H0V0z" fill="none" />
125
+ </g>
126
+ <g>
127
+ <path
128
+ d="M11.99,2C6.47,2,2,6.48,2,12s4.47,10,9.99,10C17.52,22,22,17.52,22,12S17.52,2,11.99,2z M15.29,16.71L11,12.41V7h2v4.59 l3.71,3.71L15.29,16.71z" />
129
+ </g>
130
+ </svg>
120
131
  </div>
121
- <!-- <span *ngIf="project?.ws_projct_user_isBusy === true" class="project-item--isBusy-busy-text text-pulse-animation">
132
+ <span *ngIf="project?.ws_projct_user_isBusy === true" class="project-item--isBusy-busy-text text-pulse-animation">
122
133
  {{translationMap.get('Busy')}}
123
- </span> -->
134
+ </span>
124
135
  </div>
125
136
 
126
137
  </div>
@@ -336,7 +336,7 @@
336
336
 
337
337
  .project-item--isBusy-icon {
338
338
  border-radius: 50%;
339
- background-color: rgb(254,185,44);
339
+ background-color:#FEB92C;
340
340
  font-size: 14px;
341
341
  color: #fff;
342
342
  position: relative;
@@ -346,8 +346,8 @@
346
346
 
347
347
  .project-item--isBusy-busy-text {
348
348
  font-family: Helvetica, Helvetica, Arial, sans-serif;
349
- font-size: 13px;
350
- margin-left: 3px;
349
+ font-size: 11px;
350
+ // margin-left: 3px;
351
351
  position: relative;
352
352
  top: -4px;
353
353
  }
@@ -360,37 +360,37 @@
360
360
 
361
361
  @keyframes pulse {
362
362
  0% {
363
- color: transparent;
363
+ color: #999999;
364
364
  }
365
365
  50% {
366
- color: #fedd00;
366
+ color: #FEB92C;
367
367
  }
368
368
  100% {
369
- color: transparent;
369
+ color: #999999;
370
370
  }
371
371
  }
372
372
  /* Firefox */
373
373
  @-moz-keyframes pulse {
374
374
  0% {
375
- color: transparent;
375
+ color: #999999;
376
376
  }
377
377
  50% {
378
- color: #fedd00;
378
+ color: #FEB92C;
379
379
  }
380
380
  100% {
381
- color: transparent;
381
+ color: #999999;
382
382
  }
383
383
  }
384
384
  /* Safari and Chrome */
385
385
  @-webkit-keyframes pulse {
386
386
  0% {
387
- color: transparent;
387
+ color: #999999;
388
388
  }
389
389
  50% {
390
- color: #fedd00;
390
+ color: #FEB92C;
391
391
  }
392
392
  100% {
393
- color: transparent;
393
+ color: #999999;
394
394
  }
395
395
  }
396
396
 
@@ -42,7 +42,7 @@
42
42
  <ion-label part="message-text" class="waiting-for-network-msg"> Waiting for network</ion-label>
43
43
  </ion-item>
44
44
 
45
- <ion-item class="ion-no-padding" style="padding-left:0px!important ;padding-right:0px!important; height:55px" button="true"
45
+ <ion-item *ngIf="supportMode" class="ion-no-padding open-iframe-item" style="padding-left:0px!important ;padding-right:0px!important; height:55px" button="true"
46
46
  (click)="openUnsevedConversationIframe()">
47
47
  <div tabindex="0"></div>
48
48
  <app-project-item (projectIdEvent)="getLastProjectId($event)"></app-project-item>
@@ -109,7 +109,7 @@ export class ConversationListPage implements OnInit {
109
109
 
110
110
  getSupportMode() {
111
111
  this.supportMode = this.appConfigProvider.getConfig().supportMode;
112
- console.log('[ION-LIST-CONVS-COMP] - supportMode ', this.supportMode)
112
+ // console.log('[ION-LIST-CONVS-COMP] - supportMode ', this.supportMode)
113
113
  }
114
114
 
115
115
  watchToConnectionStatus() {
@@ -1,6 +1,6 @@
1
1
  <ion-header>
2
2
  <ion-toolbar>
3
- <ion-title>{{translationMap.get('UnassignedConversations') }}</ion-title>
3
+ <ion-title>{{translationMap?.get('NewConversations') }}</ion-title>
4
4
  <ion-buttons slot="end">
5
5
  <ion-button ion-button fill="clear" (click)="onClose()">
6
6
  <ion-icon slot="icon-only" name="close"></ion-icon>
@@ -9,6 +9,14 @@
9
9
  </ion-toolbar>
10
10
  </ion-header>
11
11
 
12
- <ion-content overflow-scroll="true" id="iframe-ion-content">
12
+ <ion-content overflow-scroll="true" id="iframe-ion-content"
13
+ [ngClass]="{'ion-content-black-background' : isProjectsForPanel === true}">
13
14
  <!-- <iframe id="i_frame" style="width:100%; height:99%" frameBorder="0" allowfullscreen [src]="unassigned_convs_url_sanitized"></iframe> -->
15
+ <!-- <div class="stretchspinner-unassigned-convs">
16
+ <div class="rect1"></div>
17
+ <div class="rect2"></div>
18
+ <div class="rect3"></div>
19
+ <div class="rect4"></div>
20
+ <div class="rect5"></div>
21
+ </div> -->
14
22
  </ion-content>
@@ -0,0 +1,79 @@
1
+ .ion-content-black-background {
2
+ --background: #2d323e
3
+ }
4
+
5
+ // -------------------------------------------------
6
+ // stretch spinner https://tobiasahlin.com/spinkit/
7
+ // -------------------------------------------------
8
+ .stretchspinner-unassigned-convs {
9
+ margin: 100px auto;
10
+ width: 50px;
11
+ height: 40px;
12
+ text-align: center;
13
+ font-size: 10px;
14
+ position: absolute;
15
+ margin: auto;
16
+ top: 0;
17
+ left: 0;
18
+ bottom: 0;
19
+ right: 0;
20
+ }
21
+
22
+ .stretchspinner-unassigned-convs > div {
23
+ background-color: #3ea9f5;
24
+ height: 100%;
25
+ width: 6px;
26
+ display: inline-block;
27
+
28
+ -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
29
+ animation: sk-stretchdelay 1.2s infinite ease-in-out;
30
+ }
31
+
32
+ .stretchspinner-unassigned-convs .rect2 {
33
+ -webkit-animation-delay: -1.1s;
34
+ animation-delay: -1.1s;
35
+ }
36
+
37
+ .stretchspinner-unassigned-convs .rect3 {
38
+ -webkit-animation-delay: -1s;
39
+ animation-delay: -1s;
40
+ }
41
+
42
+ .stretchspinner-unassigned-convs .rect4 {
43
+ -webkit-animation-delay: -0.9s;
44
+ animation-delay: -0.9s;
45
+ }
46
+
47
+ .stretchspinner-unassigned-convs .rect5 {
48
+ -webkit-animation-delay: -0.8s;
49
+ animation-delay: -0.8s;
50
+ }
51
+
52
+ @-webkit-keyframes sk-stretchdelay {
53
+ 0%,
54
+ 40%,
55
+ 100% {
56
+ -webkit-transform: scaleY(0.4);
57
+ }
58
+ 20% {
59
+ -webkit-transform: scaleY(1);
60
+ }
61
+ }
62
+
63
+ @keyframes sk-stretchdelay {
64
+ 0%,
65
+ 40%,
66
+ 100% {
67
+ transform: scaleY(0.4);
68
+ -webkit-transform: scaleY(0.4);
69
+ }
70
+ 20% {
71
+ transform: scaleY(1);
72
+ -webkit-transform: scaleY(1);
73
+ }
74
+ }
75
+
76
+
77
+ .hide-stretchspinner {
78
+ display: none;
79
+ }
@@ -17,9 +17,12 @@ export class UnassignedConversationsPage implements OnInit {
17
17
  @Input() unassigned_convs_url: any;
18
18
  unassigned_convs_url_sanitized: any;
19
19
  private logger: LoggerService = LoggerInstance.getInstance();
20
- has_loaded: boolean;
20
+ // has_loaded: boolean;
21
21
  ion_content: any;
22
22
  iframe: any;
23
+
24
+ isProjectsForPanel: boolean = false
25
+
23
26
  public translationMap: Map<string, string>;
24
27
  constructor(
25
28
  private modalController: ModalController,
@@ -29,62 +32,62 @@ export class UnassignedConversationsPage implements OnInit {
29
32
  ) { }
30
33
 
31
34
  ngOnInit() {
32
- const keys = ['UnassignedConversations'];
35
+ const keys = ['UnassignedConversations', 'NewConversations'];
33
36
  this.translationMap = this.translateService.translateLanguage(keys);
37
+ this.buildIFRAME();
38
+ this.listenToPostMsg();
39
+ }
34
40
 
41
+ buildIFRAME() {
35
42
  this.logger.log('[UNASSIGNED-CONVS-PAGE] - UNASSIGNED CONVS URL (ngOnInit)', this.unassigned_convs_url);
36
- // this.unassigned_convs_url_sanitized = this.sanitizer.bypassSecurityTrustResourceUrl(this.unassigned_convs_url);
37
- // this.unassigned_convs_url_sanitized = this.sanitizer.bypassSecurityTrustHtml(this.unassigned_convs_url);
38
43
  this.unassigned_convs_url_sanitized = this.sanitizer.sanitize(SecurityContext.URL, this.unassigned_convs_url)
39
44
  this.logger.log('[UNASSIGNED-CONVS-PAGE] - UNASSIGNED CONVS URL SANITIZED (ngOnInit)', this.unassigned_convs_url_sanitized);
40
- this.has_loaded = false
45
+ // this.has_loaded = false
41
46
 
42
47
  this.ion_content = document.getElementById("iframe-ion-content");
43
48
  this.iframe = document.createElement("iframe");
44
49
  this.iframe.src = this.unassigned_convs_url_sanitized;
45
50
  this.iframe.width = "100%";
46
- this.iframe.height = "99.6%";
51
+ this.iframe.height = "99%";
47
52
  this.iframe.id = "unassigned-convs-iframe"
48
53
  this.iframe.frameBorder = "0";
49
54
  this.iframe.style.border = "none";
50
55
  this.iframe.style.background = "white";
51
56
  this.ion_content.appendChild(this.iframe);
52
57
 
53
- // }
54
-
55
- // window.addEventListener("message", (event) => {
56
- // console.log("[UNASSIGNED-CONVS-PAGE] message event ", event);
57
-
58
- // if (event && event.data) {
59
- // if (event.data === 'finished') {
60
- // this.has_loaded = true
58
+ // this.getIframeHaLoaded()
59
+ }
61
60
 
62
- // }
63
- // }
64
- // });
61
+ getIframeHaLoaded() {
62
+ var self = this;
63
+ var iframe = document.getElementById('unassigned-convs-iframe') as HTMLIFrameElement;;
64
+ this.logger.log('[APP-STORE-INSTALL] GET iframe ', iframe)
65
+ if (iframe) {
66
+ iframe.addEventListener("load", function () {
67
+ self.logger.log("[APP-STORE-INSTALL] GET - Finish");
68
+ let spinnerElem = <HTMLElement>document.querySelector('.stretchspinner-unassigned-convs')
69
+
70
+ self.logger.log('[APP-STORE-INSTALL] GET iframeDoc readyState spinnerElem', spinnerElem)
71
+ spinnerElem.classList.add("hide-stretchspinner")
65
72
 
73
+ });
74
+ }
66
75
  }
67
76
 
68
-
69
-
70
- // getIframeHaLoaded() {
71
- // var self = this;
72
- // var iframe = document.getElementById('i_frame') as HTMLIFrameElement;;
73
- // if (iframe) {
74
- // iframe.addEventListener("load", function () {
75
- // console.log("[UNASSIGNED-CONVS-PAGE] GET - Finish");
76
- // self.has_loaded = true
77
-
78
-
79
- // });
80
- // }
81
- // }
82
-
83
- // loadDeferredIframe(unassigned_convs_url_sanitized) {
84
- // // this function will load the Google homepage into the iframe
85
- // var iframe = document.getElementById("my-deferred-iframe");
86
- // iframe.src = "./" // here goes your url
87
- // };
77
+ listenToPostMsg() {
78
+ window.addEventListener("message", (event) => {
79
+ // console.log("[UNASSIGNED-CONVS-PAGE] message event ", event);
80
+
81
+ if (event && event.data) {
82
+ if (event.data === 'onInitProjectsForPanel') {
83
+ this.isProjectsForPanel = true;
84
+ }
85
+ if (event.data === 'onDestroyProjectsForPanel') {
86
+ this.isProjectsForPanel = false;
87
+ }
88
+ }
89
+ });
90
+ }
88
91
 
89
92
 
90
93
  async onClose() {
@@ -186,5 +186,6 @@
186
186
  "YouAreAboutToJoinThisChat":"You are about to join this chat",
187
187
  "Cancel": "Cancel",
188
188
  "AreYouSure":"Are you sure?",
189
- "UnassignedConversations":"Unassigned Conversations"
189
+ "UnassignedConversations":"Unassigned Conversations",
190
+ "NewConversations": "Nuove conversazioni"
190
191
  }
@@ -194,5 +194,6 @@
194
194
  "YouAreAboutToJoinThisChat":"Stai per entrare in questa chat",
195
195
  "Cancel": "Annulla",
196
196
  "AreYouSure":"Sei sicuro?",
197
- "UnassignedConversations":"Conversazioni non assegnate"
197
+ "UnassignedConversations":"Conversazioni non assegnate",
198
+ "NewConversations": "New conversations"
198
199
  }
@@ -5,7 +5,7 @@
5
5
  "logLevel": "info",
6
6
  "fileUploadAccept":"*/*",
7
7
  "authPersistence": "LOCAL",
8
- "supportMode": false,
8
+ "supportMode": true,
9
9
  "firebaseConfig": {
10
10
  "tenant": "tilechat",
11
11
  "apiKey": "AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "apiUrl": "https://tiledesk-server-pre.herokuapp.com/",
28
28
  "baseImageUrl": "https://firebasestorage.googleapis.com/v0/b/",
29
- "dashboardUrl": "http://localhost:4204/",
29
+ "dashboardUrl": "https://support-pre.tiledesk.com/dashboard/",
30
30
  "wsUrl": "wss://tiledesk-server-pre.herokuapp.com/"
31
31
  }
32
32
 
@@ -24,5 +24,6 @@
24
24
  "apiUrl": "${API_URL}",
25
25
  "baseImageUrl": "${API_BASEIMAGE_URL}",
26
26
  "dashboardUrl": "${DASHBOARD_URL}",
27
- "wsUrl": "${WS_URL}"
27
+ "wsUrl": "${WS_URL}",
28
+ "supportMode": "${SUPPORT_MODE}"
28
29
  }
@@ -24,6 +24,6 @@
24
24
  "apiUrl": "http://localhost:3000/",
25
25
  "baseImageUrl": "https://firebasestorage.googleapis.com/v0/b/",
26
26
  "dashboardUrl": "https://support-pre.tiledesk.com/dashboard/",
27
- "wsUrl": "ws://localhost:3000/"
28
-
27
+ "wsUrl": "ws://localhost:3000/",
28
+ "supportMode": false
29
29
  }
@@ -65,7 +65,7 @@ export class MQTTAuthService extends MessagingAuthService {
65
65
  // this.URL_TILEDESK_SIGNIN_WITH_CUSTOM_TOKEN = this.SERVER_BASE_URL + 'auth/signinWithCustomToken';
66
66
  this.logger.log(' ---------------- login con token url ---------------- ');
67
67
  // this.checkIsAuth();
68
- this.onAuthStateChanged();
68
+ // this.onAuthStateChanged();
69
69
  }
70
70
 
71
71
  // logout(callback) {
@@ -103,33 +103,33 @@ z
103
103
 
104
104
  /**
105
105
  */
106
- onAuthStateChanged() {
107
- this.logger.log('UserService::onAuthStateChanged');
108
- // if (this.appStorage.getItem('tiledeskToken') == null) {
109
- // this.currentUser = null;
110
- this.BSAuthStateChanged.next('offline');
111
- // }
112
-
113
- // this.logger.log("STORAGE CHANGED: added listner")
114
- // window.addEventListener('storage', (e) => {
115
- // this.logger.log('STORAGE CHANGED:', e.key);
116
- // if (this.appStorage.getItem('tiledeskToken') == null && this.appStorage.getItem('currentUser') == null) {
117
- // this.logger.log('STORAGE CHANGED: CASO TOKEN NULL');
118
- // this.currentUser = null;
119
- // // that.logout(() => {
120
- // // that.BSAuthStateChanged.next('offline');
121
- // // });
122
- // this.logout();
123
- // }
124
- // else if (this.currentUser == null && this.appStorage.getItem('tiledeskToken') != null && this.appStorage.getItem('currentUser') != null) {
125
- // this.logger.log('STORAGE CHANGED: CASO LOGGED OUTSIDE');
126
- // this.currentUser = JSON.parse(this.appStorage.getItem('currentUser'));
127
- // const tiledeskToken = this.appStorage.getItem('tiledeskToken');
128
- // this.connectWithCustomToken(tiledeskToken);
129
- // }
130
- // }, false);
106
+ // onAuthStateChanged() {
107
+ // this.logger.log('UserService::onAuthStateChanged');
108
+ // // if (this.appStorage.getItem('tiledeskToken') == null) {
109
+ // // this.currentUser = null;
110
+ // this.BSAuthStateChanged.next('offline');
111
+ // // }
112
+
113
+ // // this.logger.log("STORAGE CHANGED: added listner")
114
+ // // window.addEventListener('storage', (e) => {
115
+ // // this.logger.log('STORAGE CHANGED:', e.key);
116
+ // // if (this.appStorage.getItem('tiledeskToken') == null && this.appStorage.getItem('currentUser') == null) {
117
+ // // this.logger.log('STORAGE CHANGED: CASO TOKEN NULL');
118
+ // // this.currentUser = null;
119
+ // // // that.logout(() => {
120
+ // // // that.BSAuthStateChanged.next('offline');
121
+ // // // });
122
+ // // this.logout();
123
+ // // }
124
+ // // else if (this.currentUser == null && this.appStorage.getItem('tiledeskToken') != null && this.appStorage.getItem('currentUser') != null) {
125
+ // // this.logger.log('STORAGE CHANGED: CASO LOGGED OUTSIDE');
126
+ // // this.currentUser = JSON.parse(this.appStorage.getItem('currentUser'));
127
+ // // const tiledeskToken = this.appStorage.getItem('tiledeskToken');
128
+ // // this.connectWithCustomToken(tiledeskToken);
129
+ // // }
130
+ // // }, false);
131
131
 
132
- }
132
+ // }
133
133
 
134
134
  createCustomToken(tiledeskToken: any): void {
135
135
  this.connectWithCustomToken(tiledeskToken)