@chat21/chat21-web-widget 5.0.69-rc.1 → 5.0.70-ionic

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,20 @@
1
1
  # chat21-web-widget ver 5.0
2
2
 
3
+ ### 5.0.70-ionic in PROD
4
+ - bug-fixed: widget not showed when click on launch button if is in mobile ionic app
5
+
6
+ ### 5.0.70 in PROD
7
+
8
+ ### 5.0.70-rc.1
9
+ - changed: chat21client.js version to v0.1.12.5
10
+ - changed: set callback function on chat21client.connect without wait the subscription get back
11
+
12
+ ### 5.0.69 in PROD
13
+
14
+ ### 5.0.69-rc.2
15
+ - changed: chat21client.js version to v0.1.12.5
16
+ - changed: set callback function on chat21client.connect without wait the subscription get back
17
+
3
18
  ### 5.0.69-rc.1
4
19
  - added: display/dispose widget on mobile/desktop behavior
5
20
  - added: open/close widget on page change behavior
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.69-rc.1",
4
+ "version": "5.0.70-ionic",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -66,7 +66,6 @@ export class LastMessageComponent implements OnInit, AfterViewInit, OnDestroy {
66
66
  this.messages.push(conversationToMessage(this.conversation, this.g.senderId))
67
67
  this.manageIframeHeight();
68
68
  }
69
- console.log('messsageeeeeeeee', this.messages)
70
69
  // if(isImage(this.conversation)){
71
70
  // this.fileSelected = Object.assign({}, this.conversation.metadata)
72
71
  // this.fileSelected = Object.assign(this.fileSelected, this.getMetadataSize(this.fileSelected))
@@ -394,7 +394,7 @@ export class Globals {
394
394
  /**enable user to set a telegram number to chat with */
395
395
  this.fileUploadAccept = "image/*,.pdf,.txt"
396
396
  /**enable auto disconnect from messaging after a defined amount of time (s)*/
397
- this.disconnetTime = 60
397
+ this.disconnetTime = 0
398
398
 
399
399
  this.showWaitTime = true;
400
400
 
@@ -568,7 +568,7 @@ export class Globals {
568
568
  if(isOpen && isMobile){
569
569
  //block body scroll
570
570
  // window.parent.document.body.style.height = '100vh';
571
- window.parent.document.body.style.height = '0';
571
+ // window.parent.document.body.style.height = '0';
572
572
  window.parent.document.body.style.width = '100%';
573
573
  window.parent.document.body.style.overflowY = 'hidden'
574
574
  window.parent.document.body.style.position = 'fixed';
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  Chat21Client
3
3
 
4
- v0.1.12.5
4
+ v0.1.12.6
5
5
 
6
6
  @Author Andrea Sponziello
7
7
  @Member Gabriele Panico
@@ -101,7 +101,7 @@ class Chat21Client {
101
101
  }
102
102
 
103
103
  sendMessage(text, type, recipient_id, recipient_fullname, sender_fullname, attributes, metadata, channel_type, callback) {
104
- // console.log("sendMessage:",text, recipient_id)
104
+ // console.log("sendMessage sattributes:", attributes);
105
105
  let dest_topic = `apps/${this.appid}/outgoing/users/${this.user_id}/messages/${recipient_id}/outgoing`
106
106
  // console.log("dest_topic:", dest_topic)
107
107
  let outgoing_message = {
@@ -551,6 +551,7 @@ class Chat21Client {
551
551
  }
552
552
  this.subscribeToMyConversations(() => {
553
553
  // no more than one "on_message" handler, thanks.
554
+ // console.log("Subscribed to MyConversations.");
554
555
  this.on_message_handler = this.client.on('message', (topic, message) => {
555
556
  if (this.log) {
556
557
  console.log("topic:" + topic + "\nmessage payload:" + message)
@@ -630,6 +631,7 @@ class Chat21Client {
630
631
  if (topic.includes("/messages/") && topic.endsWith(_CLIENTADDED)) {
631
632
  if (this.onMessageAddedCallbacks) {
632
633
  this.onMessageAddedCallbacks.forEach((callback, handler, map) => {
634
+ // console.log("DEBUG: MESSAGE:", message)
633
635
  callback(JSON.parse(message.toString()), _topic)
634
636
  });
635
637
  }
@@ -924,6 +926,7 @@ class Chat21Client {
924
926
  })
925
927
  .then(function (response) {
926
928
  if (log) {console.log("response.status:", response.status);}
929
+ // if (log) {console.log("response.data:", response.data);}
927
930
  if (callback) {
928
931
  callback(null, response.headers, response.data);
929
932
  }
@@ -992,6 +995,7 @@ class Chat21Client {
992
995
  }
993
996
  if (this.log) {console.log("starting mqtt connection with LWT on:", this.presence_topic, this.endpoint)}
994
997
  // client = mqtt.connect('mqtt://127.0.0.1:15675/ws',options)
998
+ //console.log("starting mqtt connection with LWT on:", this.presence_topic, this.endpoint)
995
999
  this.client = mqtt.connect(this.endpoint,options)
996
1000
 
997
1001
  this.client.on('connect', // TODO if token is wrong it must reply with an error!
@@ -1000,8 +1004,9 @@ class Chat21Client {
1000
1004
  if (!this.connected) {
1001
1005
  if (this.log) {console.log("Chat client first connection for:" + user_id)}
1002
1006
  this.connected = true
1007
+ callback();
1003
1008
  this.start( () => {
1004
- callback();
1009
+ // callback();
1005
1010
  });
1006
1011
  }
1007
1012
  this.client.publish(