@chat21/chat21-web-widget 5.0.44 → 5.0.46-rc.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-web-widget",
3
3
  "author": "Tiledesk SRL",
4
- "version": "5.0.44",
4
+ "version": "5.0.46-rc.1",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -48,7 +48,7 @@ export class SettingsSaverService {
48
48
  // console.log('key: ', key);
49
49
  // console.log('val: ', val);
50
50
  // console.log('========================================');
51
- this.appStorageService.setItem(key, stringToBoolean(value));
51
+ // this.appStorageService.setItem(key, stringToBoolean(value));
52
52
 
53
53
  //this.g.wdLog(['SET key: ', key, ' - VAL: ', stringToBoolean(value), ' ---------->', JSON.stringify(value) ]);
54
54
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  Chat21Client
3
3
 
4
- v0.1.12.2
4
+ v0.1.12.3
5
5
 
6
6
  @Author Andrea Sponziello
7
7
  (c) Tiledesk 2020
@@ -632,10 +632,10 @@ class Chat21Client {
632
632
  // console.log("Observing conversations added from messages", message_json);
633
633
  // if (this.onConversationAddedCallbacks) {
634
634
  let update_conversation = true;
635
- // temporarily ignoring the updateconversation = false option
636
- // if (message_json.attributes && message_json.attributes.updateconversation == false) {
637
- // update_conversation = false
638
- // }
635
+
636
+ if (message_json.attributes && message_json.attributes.updateconversation == false) {
637
+ update_conversation = false
638
+ }
639
639
  if (update_conversation && this.onConversationAddedCallbacks) {
640
640
  this.onConversationAddedCallbacks.forEach((callback, handler, map) => {
641
641
  message_json.is_new = true;
@@ -220,40 +220,6 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
220
220
  // this.ref.off();
221
221
  }
222
222
 
223
-
224
- // ---------------------------------------------------------- //
225
- // BEGIN PRIVATE FUNCTIONS
226
- // ---------------------------------------------------------- //
227
- /** */
228
- // private setAttributes(): any {
229
- // const attributes: any = {
230
- // client: this.CLIENT_BROWSER,
231
- // sourcePage: location.href,
232
-
233
- // };
234
-
235
- // if(this.loggedUser && this.loggedUser.email ){
236
- // attributes.userEmail = this.loggedUser.email
237
- // }
238
- // if(this.loggedUser && this.loggedUser.fullname) {
239
- // attributes.userFullname = this.loggedUser.fullname
240
- // }
241
-
242
-
243
- // // let attributes: any = JSON.parse(sessionStorage.getItem('attributes'));
244
- // // if (!attributes || attributes === 'undefined') {
245
- // // attributes = {
246
- // // client: this.CLIENT_BROWSER,
247
- // // sourcePage: location.href,
248
- // // userEmail: this.loggedUser.email,
249
- // // userFullname: this.loggedUser.fullname
250
- // // };
251
- // // this.logger.printLog('>>>>>>>>>>>>>> setAttributes: ', JSON.stringify(attributes));
252
- // // sessionStorage.setItem('attributes', JSON.stringify(attributes));
253
- // // }
254
- // return attributes;
255
- // }
256
-
257
223
  /** */
258
224
  private added(childSnapshot: any) {
259
225
  const msg = this.messageGenerate(childSnapshot);
@@ -350,11 +316,6 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
350
316
  if (messageType(MESSAGE_TYPE_INFO, msg)) {
351
317
  this.translateInfoSupportMessages(msg);
352
318
  }
353
- /// commented because NOW ATTRIBUTES COMES FROM OUTSIDE
354
- // if (msg.attributes && msg.attributes.projectId) {
355
- // this.attributes.projectId = msg.attributes.projectId;
356
- // // sessionStorage.setItem('attributes', JSON.stringify(attributes));
357
- // }
358
319
  return msg;
359
320
  }
360
321
 
@@ -380,11 +341,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
380
341
  if (messageType(MESSAGE_TYPE_INFO, msg)) {
381
342
  this.translateInfoSupportMessages(msg);
382
343
  }
383
- /// commented because NOW ATTRIBUTES COMES FROM OUTSIDE
384
- // if (msg.attributes && msg.attributes.projectId) {
385
- // this.attributes.projectId = msg.attributes.projectId;
386
- // // sessionStorage.setItem('attributes', JSON.stringify(attributes));
387
- // }
344
+
388
345
  return msg;
389
346
  }
390
347
 
@@ -212,26 +212,6 @@ export class MQTTConversationHandler extends ConversationHandlerService {
212
212
  // this.ref.off();
213
213
  }
214
214
 
215
-
216
- // ---------------------------------------------------------- //
217
- // BEGIN PRIVATE FUNCTIONS
218
- // ---------------------------------------------------------- //
219
- /** */
220
- // private setAttributes(): any {
221
- // let attributes: any = JSON.parse(sessionStorage.getItem('attributes'));
222
- // if (!attributes || attributes === 'undefined') {
223
- // attributes = {
224
- // client: this.CLIENT_BROWSER,
225
- // sourcePage: location.href,
226
- // userEmail: this.loggedUser.email,
227
- // userFullname: this.loggedUser.fullname
228
- // };
229
- // this.logger.log('>>>>>>>>>>>>>> setAttributes: ', JSON.stringify(attributes));
230
- // sessionStorage.setItem('attributes', JSON.stringify(attributes));
231
- // }
232
- // return attributes;
233
- // }
234
-
235
215
  /** */
236
216
  private addedMessage(messageSnapshot: any) {
237
217
  const msg = this.messageGenerate(messageSnapshot);