@chat21/chat21-web-widget 5.0.56-rc.5 → 5.0.56

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,11 @@
1
1
  # chat21-web-widget ver 5.0
2
2
 
3
+ ### 5.0.56 in PROD
4
+
5
+ ### 5.0.56-rc.6
6
+ - bug-fixed: setPresence not fired due to undefined reading Query in database
7
+ - bug-fixed: multiple rules was done--> do only the first that match the regex
8
+
3
9
  ### 5.0.56-rc.5
4
10
  - added: if hideFooterTextReply is set to true, hide footer input area and display logo
5
11
  - added: mobileMarginX and mobileMarginY property to dev page
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.56-rc.5",
4
+ "version": "5.0.56",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -387,8 +387,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
387
387
  new Promise(async (resolve, reject)=> {
388
388
  that.typingService.initialize(this.g.tenant);
389
389
  await that.presenceService.initialize(this.g.tenant);
390
+ resolve(null)
390
391
  }).then(()=>{
391
- that.presenceService.setPresence(user.uid);
392
+ that.presenceService.setPresence(user.uid);
392
393
  });
393
394
 
394
395
  // this.initConversationsHandler(this.g.tenant, that.g.senderId);
@@ -38,10 +38,12 @@ export class Rules {
38
38
  }
39
39
 
40
40
  checkRules(){
41
+ let exit = false;
41
42
  this.rules.forEach((rule, index)=>{
42
- if(rule.when && new RegExp(rule.when.urlMatches).test(this.windowContext.location.href)){
43
+ if(!exit && rule.when && new RegExp(rule.when.urlMatches).test(this.windowContext.location.href)){
43
44
  if(this.checkIfAlreadyDone(rule)){
44
45
  this.doAction(rule.do)
46
+ exit = true
45
47
  return;
46
48
  }
47
49
 
@@ -50,7 +52,7 @@ export class Rules {
50
52
  }
51
53
 
52
54
  private doAction(action: Rule['do']){
53
- this.logger.info('[RULES] doAction', this.currentUser, action)
55
+ this.logger.info('[RULES] doAction', this.request_id, this.currentUser, action)
54
56
  let message = action.filter(obj => Object.keys(obj).includes('message'))
55
57
  if(message && message.length>0){
56
58
  message[0]['message'].attributes = { ...this.g.attributes, ...message[0]['message'].attributes}
@@ -387,10 +387,3 @@ export function getUnique(arr, comp) {
387
387
  // eliminate the dead keys & store unique objects
388
388
  .filter(e => arr[e]).map(e => arr[e]);
389
389
  }
390
-
391
- export function isJustRecived(startedAt, time) {
392
- if (time > startedAt) {
393
- return true;
394
- }
395
- return false;
396
- }
@@ -87,6 +87,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
87
87
  this.showInfoMessage = showInfoMessage
88
88
  // this.attributes = this.setAttributes();
89
89
  const { default: firebase} = await import("firebase/app");
90
+ await Promise.all([import("firebase/database")]);
90
91
  this.firebase = firebase
91
92
  this.ref = this.firebase.database['Query'];
92
93
  }
@@ -47,7 +47,9 @@ export class FirebasePresenceService extends PresenceService {
47
47
  this.urlNodePresence = '/apps/' + this.tenant + '/presence/';
48
48
 
49
49
  const { default: firebase} = await import("firebase/app");
50
+ await Promise.all([import("firebase/database")]);
50
51
  this.firebase = firebase
52
+ return;
51
53
  }
52
54
 
53
55
  /**
@@ -168,6 +170,7 @@ export class FirebasePresenceService extends PresenceService {
168
170
  */
169
171
  private referenceLastOnlineForUser(userid: string): any {
170
172
  const urlNodeLastOnLine = this.urlNodePresence + userid + '/lastOnline';
173
+ this.logger.log('referenceLastOnlineForUser', urlNodeLastOnLine)
171
174
  const lastOnlineRef = this.firebase.database().ref().child(urlNodeLastOnLine);
172
175
  return lastOnlineRef;
173
176
  }
@@ -53,7 +53,7 @@ export class MQTTPresenceService extends PresenceService {
53
53
  }
54
54
 
55
55
  public setPresence(userid: string): void {
56
-
56
+
57
57
  }
58
58
 
59
59
  /**
@@ -84,7 +84,7 @@ export function contactsRef(tenant) {
84
84
  // }
85
85
 
86
86
  /**
87
- * @deprecated
87
+ *
88
88
  */
89
89
  // export function setHeaderDate(translate, timestamp): string {
90
90
  // // const LABEL_TODAY = translate.get('LABEL_TODAY');