@chat21/chat21-ionic 3.0.86 → 3.0.88-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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.88-rc.1
4
+ - bug-fixed: projectId is undefined
5
+ - bug-fixed: typing subscription block UI on first conversation click
6
+
7
+ ### 3.0.87 in PROD
8
+ - restored version 3.0.85
9
+
3
10
  ### 3.0.86 in PROD
4
11
 
5
12
  ### 3.0.86-rc.6
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.0.86",
4
+ "version": "3.0.88-rc.1",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -1,3 +1,4 @@
1
+ import { DomSanitizer } from '@angular/platform-browser';
1
2
  import {
2
3
  Component,
3
4
  OnInit,
@@ -225,8 +226,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
225
226
  public tiledeskService: TiledeskService,
226
227
  private networkService: NetworkService,
227
228
  private events: EventsService,
228
- private renderer: Renderer2,
229
- private el: ElementRef
229
+ private sanitizer: DomSanitizer
230
230
  ) {
231
231
  // Change list on date change
232
232
  this.route.paramMap.subscribe((params) => {
@@ -247,11 +247,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
247
247
  ngOnInit() {
248
248
  this.logger.log('[CONVS-DETAIL] > ngOnInit - window.location: ', window.location);
249
249
 
250
- this.getConversations();
251
- this.watchToConnectionStatus();
252
- this.getOSCODE();
253
- this.getStoredProjectAndUserRole();
254
- this.listenToDsbrdPostMsgs();
250
+ // this.getConversations();
251
+ // this.watchToConnectionStatus();
252
+ // this.getOSCODE();
253
+ // this.getStoredProjectAndUserRole();
254
+ // this.listenToDsbrdPostMsgs();
255
255
 
256
256
  }
257
257
 
@@ -517,11 +517,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
517
517
  this.initSubscriptions()
518
518
  this.startConversation()
519
519
  this.getLeadDetail()
520
+ this.initializeTyping();
520
521
  }
521
522
  this.addEventsKeyboard()
522
523
  this.updateConversationBadge() // AGGIORNO STATO DELLA CONVERSAZIONE A 'LETTA' (is_new = false)
523
524
 
524
- this.initializeTyping();
525
+
525
526
  }
526
527
 
527
528
  _getProjectIdByConversationWith(conversationWith: string) {
@@ -686,18 +687,27 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
686
687
  ]
687
688
  return this.customTranslateService.translateLanguage(keys)
688
689
  }
689
-
690
690
  private setStyleMap(){
691
- this.styleMap.set('themeColor', 'var(--basic-blue)')
692
- .set('bubbleReceivedBackground','var(--bck-msg-received)')
693
- .set('bubbleReceivedTextColor', 'var(--col-msg-received)')
694
- .set('bubbleSentBackground', 'var(--bck-msg-sent)')
695
- .set('bubbleSentTextColor', 'var(--col-msg-sent)')
696
- .set('buttonFontSize','var(--button-in-msg-font-size)')
697
- .set('buttonBackgroundColor', 'var(--buttonBackgroundColor)')
698
- .set('buttonTextColor', 'var(--buttonTextColor)')
699
- .set('buttonHoverBackgroundColor', 'var(--buttonHoverBackgroundColor)')
700
- .set('buttonHoverTextColor', 'var(--buttonHoverTextColor)')
691
+ // this.styleMap.set('themeColor', 'var(--basic-blue)')
692
+ // .set('bubbleReceivedBackground','var(--bck-msg-received)')
693
+ // .set('bubbleReceivedTextColor', 'var(--col-msg-received)')
694
+ // .set('bubbleSentBackground', 'var(--bck-msg-sent)')
695
+ // .set('bubbleSentTextColor', 'var(--col-msg-sent)')
696
+ // .set('buttonFontSize','var(--button-in-msg-font-size)')
697
+ // .set('buttonBackgroundColor', 'var(--buttonBackgroundColor)')
698
+ // .set('buttonTextColor', 'var(--buttonTextColor)')
699
+ // .set('buttonHoverBackgroundColor', 'var(--buttonHoverBackgroundColor)')
700
+ // .set('buttonHoverTextColor', 'var(--buttonHoverTextColor)')
701
+ this.styleMap.set('themeColor', '#2a69c1')
702
+ .set('bubbleReceivedBackground','#f0f2f7')
703
+ .set('bubbleReceivedTextColor', '#06132b')
704
+ .set('bubbleSentBackground', '#2a6ac1')
705
+ .set('bubbleSentTextColor', '#ffffff')
706
+ .set('buttonFontSize','15px')
707
+ .set('buttonBackgroundColor', '#ffffff')
708
+ .set('buttonTextColor', '#2a6ac1')
709
+ .set('buttonHoverBackgroundColor', '#2a6ac1')
710
+ .set('buttonHoverTextColor', ' #ffffff')
701
711
 
702
712
  }
703
713
  // -------------------------------------------------------------------------------------
@@ -793,6 +803,14 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
793
803
  conversation.attributes.project_name = project['name']
794
804
  }
795
805
 
806
+ }else {
807
+ const projectId = this.getProjectIdSelectedConversation(this.conversationWith)
808
+ let project = localStorage.getItem(projectId)
809
+ if(project){
810
+ project = JSON.parse(project)
811
+ conversation.attributes.projectId = project['_id']
812
+ conversation.attributes.project_name = project['name']
813
+ }
796
814
  }
797
815
  return conversation
798
816
  }
@@ -1059,7 +1077,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1059
1077
  subscription = this.subscriptions.find((item) => item.key === subscriptionKey)
1060
1078
  if (!subscription) {
1061
1079
  subscription = this.conversationHandlerService.messageInfo.pipe(takeUntil(this.unsubscribe$)).subscribe((msg: any) => {
1062
- this.logger.log('[CONVS-DETAIL] subscribe to messageInfo - messageId ', msg)
1080
+ this.logger.log('[CONVS-DETAIL] subscribe to messageInfo - messageId ', msg, this.conversation)
1063
1081
  if (msg) {
1064
1082
  that.updateLeadInfo(msg)
1065
1083
  // this.setHeaderContent()
@@ -104,44 +104,6 @@ export class FirebaseAuthService extends MessagingAuthService {
104
104
  });
105
105
 
106
106
 
107
- }
108
-
109
- checkInternetConnection() {
110
- this.logger.log('[FIREBASEAuthSERVICE] - checkInternetConnection');
111
- // let connectSubscription = this.network.onConnect().subscribe(() => {
112
- // this.logger.log('[FIREBASEAuthSERVICE] - network connected!');
113
- // // We just got a connection but we need to wait briefly
114
- // // before we determine the connection type. Might need to wait.
115
- // // prior to doing any api requests as well.
116
- // setTimeout(() => {
117
- // if (this.network.type === 'wifi') {
118
- // this.logger.log('[FIREBASEAuthSERVICE] - we got a wifi connection, woohoo!');
119
- // }
120
- // }, 3000);
121
- // });
122
-
123
-
124
- // this.connectionService.monitor().subscribe(isConnected => {
125
- // this.isConnected = isConnected;
126
- // this.logger.log('[FIREBASEAuthSERVICE] - checkInternetConnection isConnected', isConnected);
127
- // if (this.isConnected) {
128
- // this.status = "ONLINE";
129
-
130
- // // this.onAuthStateChanged();
131
- // firebase.auth().onAuthStateChanged(user => {
132
- // this.logger.log('[FIREBASEAuthSERVICE] checkInternetConnection onAuthStateChanged', user)
133
- // })
134
- // }
135
- // else {
136
- // this.status = "OFFLINE";
137
- // // this.onAuthStateChanged();
138
- // firebase.auth().onAuthStateChanged(user => {
139
- // this.logger.log('[FIREBASEAuthSERVICE] checkInternetConnection onAuthStateChanged', user)
140
- // })
141
- // }
142
- // })
143
-
144
-
145
107
  }
146
108
 
147
109
  // createOnline$() {