@chat21/chat21-ionic 3.0.59-rc16 → 3.0.59-rc19

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,10 +1,18 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.59-rc19
4
+ - Fixes the bug: when the chat is in "mobile" mode and from the dashboard the agent clicks on "Open chat" for a specific conversation the "back" button of the chat does not return to the list of conversations
5
+ - Fixes the bug: when the chat is in "mobile" mode and from the dashboard the agent clicks on "Open chat" for a specific conversation the chat does not display the details of the conversation
6
+
7
+ ### 3.0.59-rc18
8
+ - Improves the "app-config" service
9
+
3
10
  ### 3.0.59-rc16
4
11
  - Changes in config.xml the value of the "SplashScreen"
5
12
  - Improves the method to avoid page reloading when an agent clicks the "Open Chat" button of the dashboard on the realtime and non-real time conversation list page and on the conversation detail page
6
13
  - Modifies the "app-config" service by adding the ability to pass relative URLs to the websocket
7
14
  - Adds "wsUrlRel" property to env.sample, chat-config-template.json and chat-config.json
15
+ - Adds a check in the "websocket-js.ts" service on the existence of the "ws" property of the "WebSocketJs" class before accessing the property "readyState"
8
16
 
9
17
  ### 3.0.59-rc15
10
18
  - Implements a method in app.components that counts and stores the number of open Chat tabs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
- "version": "3.0.59-rc16",
3
+ "version": "3.0.59-rc19",
4
4
  "author": "Tiledesk SRL",
5
5
  "homepage": "https://ionicframework.com/",
6
6
  "scripts": {
@@ -143,7 +143,9 @@ export class AppComponent implements OnInit {
143
143
  ) {
144
144
 
145
145
  this.saveInStorageNumberOfOpenedChatTab();
146
- this.getPageState();
146
+
147
+ this.listenToUrlChanges();
148
+ // this.getPageState();
147
149
 
148
150
  // location.subscribe((val) => {
149
151
 
@@ -160,46 +162,48 @@ export class AppComponent implements OnInit {
160
162
  // }
161
163
  // });
162
164
 
165
+
166
+
167
+
168
+ }
169
+
170
+ listenToUrlChanges() {
171
+ const self = this;
163
172
  window.addEventListener('hashchange', function () {
164
- console.log('location changed!');
173
+ // console.log('location changed!');
174
+
165
175
  const convId = getParameterByName('convId')
166
- console.log('[APP-COMP] ngOnInit convId get with getParameterByName ', convId)
167
-
176
+ // console.log('[APP-COMP] getParameterByName convId ', convId)
168
177
  if (convId) {
169
178
  setTimeout(() => {
170
- events.publish('convid:haschanged', convId);
179
+ self.events.publish('supportconvid:haschanged', convId);
171
180
  }, 0);
172
181
  }
173
-
174
-
175
- // this.navigateToDetail(convId, requesterFullaname)
176
-
177
-
178
-
179
- })
180
182
 
183
+ const contact_id = getParameterByName('contact_id')
184
+ // console.log('[APP-COMP] getParameterByName contact_id ', contact_id)
185
+ const contact_fullname = getParameterByName('contact_fullname')
186
+ // console.log('[APP-COMP] getParameterByName contact_fullname ', contact_fullname)
187
+ if (contact_id && contact_fullname) {
188
+ setTimeout(() => {
189
+ self.router.navigateByUrl('conversation-detail/' + contact_id + '/' + contact_fullname + '/new');
190
+ self.events.publish('directconvid:haschanged', contact_id);
191
+ }, 0);
192
+
193
+ } else {
194
+ // console.log('[APP-COMP] contact_id and contact_fullname are null')
195
+ }
181
196
 
182
- // router.events.subscribe((val) => {
183
- // this.checkCurrentURL();
184
- // });
185
- // FOR TEST
186
- // const last_project = { "user_available": true, "number_assigned_requests": 59, "last_login_at": "2021-08-09T17:30:55.234Z", "status": "active", "_id": "6112bc8f58c958003495a2cb", "id_project": { "status": 100, "_id": "60ffe291f725db00347661ef", "name": "27-LUGLIO-21-STRIPE-TEST", "activeOperatingHours": false, "createdBy": "608ad02d3a4dc000344ade17", "profile": { "name": "pro", "trialDays": 30, "agents": 5, "type": "payment", "subStart": "2021-11-18T10:42:41.000Z", "subEnd": "2021-11-19T10:42:41.000Z", "subscriptionId": "sub_Jvf4kABe9t8JvX", "last_stripe_event": "invoice.payment_succeeded" }, "versions": 20115, "channels": [{ "name": "chat21" }], "createdAt": "2021-07-27T10:40:17.752Z", "updatedAt": "2021-11-18T11:55:01.346Z", "__v": 0, "widget": { "preChatForm": true, "preChatFormJson": [{ "name": "userFullname", "type": "text", "mandatory": true, "label": { "en": "Your name", "it": "Il tuo nome" } }, { "name": "userEmail", "type": "text", "mandatory": true, "regex": "/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$/", "label": { "en": "Your email", "it": "La tua email" }, "errorLabel": { "en": "Invalid email address", "it": "Indirizzo email non valido" } }, { "name": "tel", "mandatory": true, "label": { "en": "Your phone number", "it": "Il tuo numero di telefono" } }], "preChatFormCustomFieldsEnabled": true }, "trialExpired": true, "trialDaysLeft": 84, "isActiveSubscription": true, "id": "60ffe291f725db00347661ef" }, "id_user": "60aa0fef1482fe00346854a7", "role": "admin", "createdBy": "608ad02d3a4dc000344ade17", "createdAt": "2021-08-10T17:51:11.318Z", "updatedAt": "2021-11-19T08:08:21.437Z", "__v": 0, "presence": { "status": "online", "changedAt": "2021-11-19T08:08:21.432Z" }, "isAuthenticated": true, "id": "6112bc8f58c958003495a2cb" }
187
- // localStorage.setItem('last_project', JSON.stringify(last_project))
188
- }
189
- navigateToDetail(convId, requesterFullaname) {
190
- console.log('[APP-COMP] navigateToDetail ');
191
- let pageUrl = 'conversation-detail/' + convId + '/' + requesterFullaname + '/active';
192
- this.router.navigateByUrl(pageUrl);
193
- this.location.replaceState('conversation-detail/' + convId + '/' + requesterFullaname + '/active');
197
+ const conversation_detail = getParameterByName('conversation_detail')
198
+ // console.log('[APP-COMP] getParameterByName conversation_detail ', conversation_detail)
199
+ if (conversation_detail) {
200
+ setTimeout(() => {
201
+ self.router.navigate(['conversation-detail/'])
202
+ }, 0);
203
+ }
204
+ });
194
205
  }
195
206
 
196
-
197
- // private checkCurrentURL() {
198
- // console.log("location : " + window.location.pathname)
199
- // const convId = getParameterByName('convId')
200
- // console.log('[APP-COMP] ngOnInit convId get with getParameterByName ', convId)
201
- // this.events.publish('convid:haschanged', convId);
202
- // }
203
207
  saveInStorageNumberOfOpenedChatTab() {
204
208
  this.logger.log('Calling saveInStorageChatOpenedTab!');
205
209
 
@@ -213,12 +217,13 @@ export class AppComponent implements OnInit {
213
217
  }
214
218
  const terminationEvent = 'onpagehide' in self ? 'pagehide' : 'unload';
215
219
  window.addEventListener(terminationEvent, (event) => {
216
- localStorage.tabCount = +localStorage.tabCount - 1;
220
+ if (localStorage.tabCount > 0) {
221
+ localStorage.tabCount = +localStorage.tabCount - 1;
222
+ }
217
223
  }, { capture: true });
218
224
  }
219
225
 
220
226
  getPageState() {
221
-
222
227
  const getState = () => {
223
228
  localStorage.setItem('visibilityState', document.visibilityState)
224
229
  if (document.visibilityState === 'hidden') {
@@ -316,17 +321,7 @@ export class AppComponent implements OnInit {
316
321
  this.listenToPostMsgs();
317
322
  }
318
323
 
319
- // ngAfterViewInit() {
320
- // console.log('[APP-COMP] ngAfterViewInit')
321
- // }
322
-
323
- // ngDoCheck(){
324
- // console.log('[APP-COMP] ngDoCheck')
325
- // }
326
-
327
-
328
-
329
-
324
+
330
325
  listenToPostMsgs() {
331
326
  window.addEventListener("message", (event) => {
332
327
  // console.log("[APP-COMP] message event ", event);
@@ -736,7 +731,7 @@ export class AppComponent implements OnInit {
736
731
  }
737
732
 
738
733
  checkPlatform() {
739
- this.logger.debug('[APP-COMP] checkPlatform');
734
+ console.log('[APP-COMP] checkPlatform');
740
735
  // let pageUrl = '';
741
736
  // try {
742
737
  // const pathPage = this.route.snapshot.firstChild.routeConfig.path;
@@ -752,16 +747,21 @@ export class AppComponent implements OnInit {
752
747
  // }
753
748
 
754
749
  if (checkPlatformIsMobile()) {
750
+ // console.log('[APP-COMP] checkPlatformIsMobile',checkPlatformIsMobile());
755
751
  this.platformIs = PLATFORM_MOBILE;
756
752
  const IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv');
757
- this.logger.log('[APP-COMP] PLATFORM_MOBILE2 navigateByUrl', PLATFORM_MOBILE, this.route.snapshot);
753
+ // console.log('[APP-COMP] platformIs', this.platformIs);
754
+ // console.log('[APP-COMP] PLATFORM', PLATFORM_MOBILE, 'route.snapshot', this.route.snapshot);
758
755
  if (!IDConv) {
759
756
  this.router.navigateByUrl('conversations-list')
760
757
  }
761
758
  // this.router.navigateByUrl(pageUrl);
762
759
  // this.navService.setRoot(ConversationListPage, {});
763
760
  } else {
761
+ // console.log('[APP-COMP] checkPlatformIsMobile',checkPlatformIsMobile());
764
762
  this.platformIs = PLATFORM_DESKTOP;
763
+ // console.log('[APP-COMP] platformIs', this.platformIs);
764
+ // console.log('[APP-COMP] PLATFORM', PLATFORM_DESKTOP, 'route.snapshot', this.route.snapshot);
765
765
  this.logger.log('[APP-COMP] PLATFORM_DESKTOP ', this.navService);
766
766
 
767
767
  this.navService.setRoot(ConversationListPage, {});
@@ -911,7 +911,7 @@ export class AppComponent implements OnInit {
911
911
 
912
912
  this.conversationsHandlerService.conversationChanged.subscribe((conversation: ConversationModel) => {
913
913
 
914
- console.log('[APP-COMP] ***** subscribeConversationChanged conversation: ', conversation);
914
+ // console.log('[APP-COMP] ***** subscribeConversationChanged conversation: ', conversation);
915
915
  const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
916
916
  this.logger.log('[APP-COMP] ***** subscribeConversationChanged current_user: ', currentUser);
917
917
 
@@ -3,10 +3,8 @@
3
3
  <ion-toolbar>
4
4
 
5
5
  <ion-buttons slot="start">
6
- <!-- (click)="pushPage('conversations-list')" -->
7
- <ion-back-button text="" *ngIf="isMobile"
8
- defaultHref="/conversations-list"
9
- >
6
+ <!-- (click)="pushPage('conversations-list')" defaultHref="/conversations-list" -->
7
+ <ion-back-button style="display: block;" text="" *ngIf="isMobile" (click)="goBackToConversationList()">
10
8
  </ion-back-button>
11
9
  </ion-buttons>
12
10
 
@@ -1,5 +1,5 @@
1
1
  import { Component, OnInit, Input, Output, EventEmitter, OnChanges } from '@angular/core';
2
- import { ActivatedRoute } from '@angular/router';
2
+ import { ActivatedRoute, Router } from '@angular/router';
3
3
  import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
4
4
 
5
5
  // Logger
@@ -43,7 +43,8 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
43
43
  constructor(
44
44
  public imageRepoService: ImageRepoService,
45
45
  private route: ActivatedRoute,
46
- public platform: Platform
46
+ public platform: Platform,
47
+ private router: Router
47
48
  ) {
48
49
  this.route.paramMap.subscribe(params => {
49
50
 
@@ -125,4 +126,8 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
125
126
  /** */
126
127
  pushPage(event) { }
127
128
 
129
+ goBackToConversationList() {
130
+ this.router.navigateByUrl('/conversations-list');
131
+ }
132
+
128
133
  }
@@ -106,23 +106,28 @@ export class ConversationListPage implements OnInit {
106
106
  this.listenGoOnline();
107
107
  this.listenGoOffline();
108
108
  this.listenToSwPostMessage();
109
- this.listenConvIdHasChanged();
110
-
109
+ this.listenSupportConvIdHasChanged();
110
+ this.listenDirectConvIdHasChanged();
111
111
  }
112
112
 
113
- listenConvIdHasChanged() {
114
- this.events.subscribe('convid:haschanged', (convId) => {
115
- console.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - convId', convId);
116
- // this.events.unsubscribe('profileInfoButtonClick:logout')
117
- // this.setUidConvSelected(uid , 'active')
118
- // const conversation = {}
113
+ listenSupportConvIdHasChanged() {
114
+ this.events.subscribe('supportconvid:haschanged', (convId) => {
115
+ // console.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - convId', convId);
119
116
  if (convId) {
120
117
  const conversationSelected = this.conversations.find(item => item.uid === convId);
121
- console.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - conversationSelected', conversationSelected);
118
+ // console.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - conversationSelected', conversationSelected);
122
119
  this.onConversationSelected(conversationSelected)
123
120
  }
124
121
  });
122
+ }
125
123
 
124
+ listenDirectConvIdHasChanged() {
125
+ this.events.subscribe('directconvid:haschanged', (contact_id) => {
126
+ // console.log('[CONVS-LIST-PAGE] - listen To directconvid:haschanged - contact_id', contact_id);
127
+ if (contact_id) {
128
+ this.uidConvSelected = contact_id
129
+ }
130
+ });
126
131
  }
127
132
 
128
133
 
@@ -135,8 +140,8 @@ export class ConversationListPage implements OnInit {
135
140
 
136
141
  const currentUrl = this.router.url;
137
142
  this.logger.log('[CONVS-LIST-PAGE] current_url ngOnInit ', currentUrl);
138
- this.route.queryParams.subscribe(params => {
139
- this.logger.log('[CONVS-LIST-PAGE] ngOnInit params', params);
143
+ // this.route.queryParams.subscribe(params => {
144
+ // this.logger.log('[CONVS-LIST-PAGE] ngOnInit params', params);
140
145
  // if (params && params.convselected) {
141
146
  // console.log('[CONVS-LIST-PAGE] ngOnInit params convselected:', params.convselected);
142
147
 
@@ -150,23 +155,23 @@ export class ConversationListPage implements OnInit {
150
155
  // } else {
151
156
  // console.log('[CONVS-LIST-PAGE] ngOnInit params NoParams ');
152
157
  // }
153
- if (params && params.contact_id && params.contact_fullname) {
154
- this.logger.log('[CONVS-LIST-PAGE] ngOnInit params contact_id:', params.contact_id, 'contact_fullname ', params.contact_fullname);
155
- this.router.navigateByUrl('conversation-detail/' + params.contact_id + '/' + params.contact_fullname + '/new');
156
- this.uidConvSelected = params.contact_id
157
- } else {
158
- this.logger.log('[CONVS-LIST-PAGE] ngOnInit params NoParams ');
159
- }
158
+ // if (params && params.contact_id && params.contact_fullname) {
159
+ // this.logger.log('[CONVS-LIST-PAGE] ngOnInit params contact_id:', params.contact_id, 'contact_fullname ', params.contact_fullname);
160
+ // this.router.navigateByUrl('conversation-detail/' + params.contact_id + '/' + params.contact_fullname + '/new');
161
+ // this.uidConvSelected = params.contact_id
162
+ // } else {
163
+ // this.logger.log('[CONVS-LIST-PAGE] ngOnInit params NoParams ');
164
+ // }
160
165
 
161
- if (params && params.conversation_detail) {
162
- this.logger.log('[CONVS-LIST-PAGE] ngOnInit params conversation_detail:', params.conversation_detail);
163
- this.router.navigateByUrl('conversation-detail/');
166
+ // if (params && params.conversation_detail) {
167
+ // this.logger.log('[CONVS-LIST-PAGE] ngOnInit params conversation_detail:', params.conversation_detail);
168
+ // this.router.navigateByUrl('conversation-detail/');
164
169
 
165
- } else {
166
- this.logger.log('[CONVS-LIST-PAGE] ngOnInit params NoParams ');
167
- }
170
+ // } else {
171
+ // this.logger.log('[CONVS-LIST-PAGE] ngOnInit params NoParams ');
172
+ // }
168
173
 
169
- });
174
+ // });
170
175
  }
171
176
 
172
177
 
@@ -605,7 +610,7 @@ export class ConversationListPage implements OnInit {
605
610
 
606
611
  if (this.route && this.route.snapshot && this.route.snapshot.firstChild) {
607
612
  const IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv');
608
- console.log('[CONVS-LIST-PAGE] conversationWith 2: ', IDConv);
613
+ this.logger.log('[CONVS-LIST-PAGE] conversationWith 2: ', IDConv);
609
614
  if (IDConv) {
610
615
  this.setUidConvSelected(IDConv);
611
616
  } else {
@@ -622,7 +627,7 @@ export class ConversationListPage implements OnInit {
622
627
  * ::: setUidConvSelected :::
623
628
  */
624
629
  setUidConvSelected(uidConvSelected: string, conversationType?: string,) {
625
- console.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected)
630
+ this.logger.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected)
626
631
  this.uidConvSelected = uidConvSelected;
627
632
  // this.conversationsHandlerService.uidConvSelected = uidConvSelected;
628
633
  if (uidConvSelected) {
@@ -642,7 +647,7 @@ export class ConversationListPage implements OnInit {
642
647
  }
643
648
 
644
649
  onConversationSelected(conversation: ConversationModel) {
645
- console.log('onConversationSelected conversation', conversation)
650
+ this.logger.log('onConversationSelected conversation', conversation)
646
651
  if (conversation.archived) {
647
652
  this.navigateByUrl('archived', conversation.uid)
648
653
  this.logger.log('[CONVS-LIST-PAGE] onConversationSelected archived conversation.uid ', conversation.uid)
@@ -739,16 +744,16 @@ export class ConversationListPage implements OnInit {
739
744
 
740
745
 
741
746
  navigateByUrl(converationType: string, uidConvSelected: string) {
742
- console.log('[CONVS-LIST-PAGE] calling navigateByUrl: ');
743
- console.log('[CONVS-LIST-PAGE] navigateByUrl uidConvSelected: ', uidConvSelected);
744
- console.log('[CONVS-LIST-PAGE] navigateByUrl run this.setUidConvSelected');
745
- console.log('[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ', this.uidConvSelected);
746
- console.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected ', this.conversationSelected)
747
+ this.logger.log('[CONVS-LIST-PAGE] calling navigateByUrl: ');
748
+ this.logger.log('[CONVS-LIST-PAGE] navigateByUrl uidConvSelected: ', uidConvSelected);
749
+ this.logger.log('[CONVS-LIST-PAGE] navigateByUrl run this.setUidConvSelected');
750
+ this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ', this.uidConvSelected);
751
+ this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected ', this.conversationSelected)
747
752
 
748
753
  this.setUidConvSelected(uidConvSelected, converationType);
749
754
  if (checkPlatformIsMobile()) {
750
- console.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile());
751
- console.log('[CONVS-LIST-PAGE] DESKTOP (window >= 768)', this.navService);
755
+ this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile());
756
+ this.logger.log('[CONVS-LIST-PAGE] DESKTOP (window >= 768)', this.navService);
752
757
  let pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType;
753
758
  this.logger.log('[CONVS-LIST-PAGE] pageURL', pageUrl)
754
759
  this.router.navigateByUrl(pageUrl);
@@ -30,7 +30,7 @@ export class AppConfigProvider {
30
30
 
31
31
  return this.http.get(this.appConfig.remoteConfigUrl)
32
32
  .toPromise().then((data: any ) => {
33
- console.log('AppConfigService loadAppConfig data: ', data);
33
+ // console.log('AppConfigService loadAppConfig data: ', data);
34
34
 
35
35
  const allconfig = data
36
36
  // console.log('[APP-CONFIG-SERVICE] - loadAppConfig allconfig: ', allconfig);
@@ -44,44 +44,46 @@ export class AppConfigProvider {
44
44
  if (wsUrlRelIsEmpty === false) {
45
45
  // console.log('[APP-CONFIG-SERVICE]- loadAppConfig allconfig !!!! exist - SERVER_BASE_URL', data.apiUrl);
46
46
 
47
- if (allconfig.apiUrl.indexOf("http://") !== -1) {
47
+ // if (allconfig.apiUrl.indexOf("http://") !== -1) {
48
48
 
49
- const ws_url = allconfig.apiUrl.replace("http://", "ws://").slice(0, -1) + allconfig.wsUrlRel;
50
- // console.log('AppConfigService loadAppConfig allconfig !!!! exist - SERVER_BASE_URL protocol is HTTP - wsUrl', ws_url);
49
+ // const ws_url = allconfig.apiUrl.replace("http://", "ws://").slice(0, -1) + allconfig.wsUrlRel;
50
+ // // console.log('AppConfigService loadAppConfig allconfig !!!! exist - SERVER_BASE_URL protocol is HTTP - wsUrl', ws_url);
51
51
 
52
- allconfig.wsUrl = ws_url
52
+ // allconfig.wsUrl = ws_url
53
53
 
54
- } else if (allconfig.apiUrl.indexOf("https://") !== -1) {
54
+ // } else if (allconfig.apiUrl.indexOf("https://") !== -1) {
55
55
 
56
- const ws_url = allconfig.apiUrl.replace("https://", "wss://").slice(0, -1) + allconfig.wsUrlRel;
56
+ // const ws_url = allconfig.apiUrl.replace("https://", "wss://").slice(0, -1) + allconfig.wsUrlRel;
57
57
 
58
- allconfig.wsUrl = ws_url
58
+ // allconfig.wsUrl = ws_url
59
59
 
60
- // console.log('AppConfigService loadAppConfig allconfig !!!! exist - SERVER_BASE_URL protocol is HTTPS - wsUrl', ws_url);
61
- } else {
62
- console.log('AppConfigService loadAppConfig allconfig !!!! exist - SERVER_BASE_URL !!! IS RELATIVE - window.location ', window.location);
60
+ // // console.log('AppConfigService loadAppConfig allconfig !!!! exist - SERVER_BASE_URL protocol is HTTPS - wsUrl', ws_url);
61
+ // } else {
62
+
63
+
64
+ // console.log('AppConfigService loadAppConfig allconfig !!!! exist - SERVER_BASE_URL !!! IS RELATIVE - window.location ', window.location);
63
65
 
64
66
  // console.log(window.location)
65
67
 
66
68
  if (window.location.protocol === 'http:') {
67
- allconfig.wsUrl = 'ws://' + window.location.hostname + '/ws/'
69
+ allconfig.wsUrl = 'ws://' + window.location.hostname + allconfig.wsUrlRel
68
70
 
69
71
  } else if (window.location.protocol === 'https:') {
70
72
 
71
- allconfig.wsUrl = 'wss://' + window.location.hostname + '/ws/'
73
+ allconfig.wsUrl = 'wss://' + window.location.hostname + allconfig.wsUrlRel
72
74
  } else {
73
75
 
74
- allconfig.wsUrl = 'ws://' + window.location.hostname + '/ws/'
76
+ allconfig.wsUrl = 'ws://' + window.location.hostname + allconfig.wsUrlRel
75
77
  }
76
- }
78
+ // }
77
79
 
78
80
  } else {
79
- console.log('[APP-CONFIG-SERVICE] loadAppConfig allconfig !!!! exist wsUrlRel but IS EMPTY');
81
+ // console.log('[APP-CONFIG-SERVICE] loadAppConfig allconfig !!!! exist wsUrlRel but IS EMPTY');
80
82
  }
81
83
 
82
84
  } else {
83
85
 
84
- console.log('[APP-CONFIG-SERVICE] loadAppConfig allconfig !!!! does not exist wsUrlRel');
86
+ // console.log('[APP-CONFIG-SERVICE] loadAppConfig allconfig !!!! does not exist wsUrlRel');
85
87
  }
86
88
 
87
89
  this.appConfig = allconfig;
@@ -19,7 +19,7 @@ export function isFirstMessage(i: number) {
19
19
  }
20
20
  return false;
21
21
  } catch (err) {
22
- console.log('error: ', err);
22
+ console.error('error: ', err);
23
23
  }
24
24
  }
25
25
  }
@@ -103,7 +103,7 @@ export function getSizeImg(message: any, maxWidthImage?: number): any {
103
103
  }
104
104
  return sizeImage;
105
105
  } catch (err) {
106
- console.log('error: ', err);
106
+ console.error('error: ', err);
107
107
  return;
108
108
  }
109
109
  }