@chat21/chat21-ionic 3.0.78-rc.1 → 3.0.78-rc.3

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +1 -1
  3. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +8 -1
  4. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +31 -2
  5. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +69 -2
  6. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +15 -2
  7. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +1 -1
  8. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +3 -1
  9. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +16 -3
  10. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +5 -2
  11. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
  12. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +52 -37
  13. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +57 -29
  14. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +8 -24
  15. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +1 -1
  16. package/src/app/components/ddp-header/ddp-header.component.html +1 -1
  17. package/src/app/components/ddp-header/ddp-header.component.scss +4 -0
  18. package/src/app/components/project-item/project-item.component.html +13 -33
  19. package/src/app/components/project-item/project-item.component.scss +8 -9
  20. package/src/app/components/project-item/project-item.component.ts +4 -3
  21. package/src/app/pages/conversation-detail/conversation-detail.page.html +14 -10
  22. package/src/app/pages/conversation-detail/conversation-detail.page.scss +0 -2
  23. package/src/app/pages/conversation-detail/conversation-detail.page.ts +161 -48
  24. package/src/assets/i18n/ar.json +268 -265
  25. package/src/assets/i18n/az.json +3 -0
  26. package/src/assets/i18n/de.json +3 -0
  27. package/src/assets/i18n/en.json +3 -0
  28. package/src/assets/i18n/es.json +3 -0
  29. package/src/assets/i18n/fr.json +3 -0
  30. package/src/assets/i18n/it.json +3 -0
  31. package/src/assets/i18n/kk.json +3 -0
  32. package/src/assets/i18n/pt.json +3 -0
  33. package/src/assets/i18n/ru.json +3 -0
  34. package/src/assets/i18n/sr.json +3 -0
  35. package/src/assets/i18n/sv.json +3 -0
  36. package/src/assets/i18n/tr.json +3 -0
  37. package/src/assets/i18n/uk.json +3 -0
  38. package/src/assets/i18n/uz.json +3 -0
  39. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
  40. package/src/chat21-core/utils/constants.ts +4 -0
  41. package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
  42. package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
  43. package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
  44. package/src/chat21-core/utils/utils.ts +5 -1
  45. package/src/variables.scss +7 -1
@@ -113,16 +113,14 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
113
113
  public lastConnectionDate: string
114
114
  public showMessageWelcome: boolean
115
115
  public openInfoConversation = false
116
- public openInfoMessage: boolean // check is open info message
117
116
  public isMobile = false
118
117
  public isLessThan991px = false // nk added
119
- public isTyping = false
120
- public nameUserTypingNow: string
121
118
 
122
119
  public heightMessageTextArea = ''
123
- public translationMap: Map<string, string>
120
+ public translationsMap: Map<string, string> = new Map()
121
+ public translationsHeaderMap: Map<string, string> = new Map()
122
+ public translationsContentMap: Map<string, string> = new Map()
124
123
  public conversationAvatar: any
125
- public membersConversation: any
126
124
  public member: UserModel
127
125
  public urlConversationSupportGroup: any
128
126
  public isFileSelected: boolean
@@ -148,7 +146,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
148
146
  //SOUND
149
147
  setTimeoutSound: any;
150
148
  audio: any;
151
- isOpenInfoConversation: boolean;
152
149
  USER_HAS_OPENED_CLOSE_INFO_CONV: boolean = false;
153
150
  isHovering: boolean = false;
154
151
  conversation_count: number;
@@ -169,6 +166,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
169
166
  public disableTextarea: boolean;
170
167
  appsidebarIsWide: boolean;
171
168
 
169
+ // ========== begin:: typying =======
170
+ public isTypings = false;
171
+ public isDirect = false;
172
+ public idUserTypingNow: string;
173
+ public nameUserTypingNow: string;
174
+ private setTimeoutWritingMessages;
175
+ membersConversation = ['SYSTEM'];
176
+ // ========== end:: typying =======
177
+
172
178
  /**
173
179
  * Constructor
174
180
  * @param route
@@ -237,21 +243,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
237
243
  // -----------------------------------------------------------
238
244
  ngOnInit() {
239
245
  this.logger.log('[CONVS-DETAIL] > ngOnInit - window.location: ', window.location);
240
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept: ', this.appConfigProvider.getConfig().fileUploadAccept);
241
- // const accept_files = this.appConfigProvider.getConfig().fileUploadAccept;
242
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept typeof accept_files ', typeof accept_files);
243
- // const accept_files_array = accept_files.split(',')
244
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_files_array ', accept_files_array);
245
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_files_array typeof: ', typeof accept_files_array);
246
-
247
- // accept_files_array.forEach(accept_file => {
248
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_file ', accept_file);
249
- // const accept_file_segment = accept_file.split('/')
250
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_file_segment ', accept_file_segment);
251
- // if (accept_file_segment[1] === '*') {
252
-
253
- // }
254
- // });
246
+
255
247
  this.getConversations();
256
248
  this.watchToConnectionStatus();
257
249
  this.getOSCODE();
@@ -336,7 +328,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
336
328
  // this.updateConversationBadge()
337
329
  // }
338
330
  if(conv.uid && conv.uid === this.conversationWith){
339
- this.conversationAvatar = setConversationAvatar(conv.conversation_with,conv.conversation_with_fullname,conv.channel_type)
331
+ this.conversationAvatar = setConversationAvatar(
332
+ conv.conversation_with,
333
+ conv.conversation_with_fullname,
334
+ conv.channel_type,
335
+ conv.attributes['projectId'],
336
+ conv.attributes['project_name'])
340
337
  }
341
338
 
342
339
  }
@@ -474,6 +471,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
474
471
  this.loggedUser = this.tiledeskAuthService.getCurrentUser()
475
472
  this.logger.log('[CONVS-DETAIL] - initialize -> loggedUser: ', this.loggedUser)
476
473
  this.translations()
474
+ this.setStyleMap()
477
475
  // this.conversationSelected = localStorage.getItem('conversationSelected');
478
476
  this.showButtonToBottom = false
479
477
  this.showMessageWelcome = false
@@ -488,7 +486,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
488
486
 
489
487
  this.messages = [] // list messages of conversation
490
488
  this.isFileSelected = false // indicates if a file has been selected (image to upload)
491
- this.openInfoMessage = false // indicates whether the info message panel is open
492
489
 
493
490
  if (checkPlatformIsMobile()) {
494
491
  this.isMobile = true
@@ -504,13 +501,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
504
501
  if (checkWindowWidthIsLessThan991px()) {
505
502
  this.logger.log('[CONVS-DETAIL] - initialize -> checkWindowWidthIsLessThan991px ', checkWindowWidthIsLessThan991px())
506
503
  this.openInfoConversation = false // indica se è aperto il box info conversazione
507
- this.isOpenInfoConversation = false
508
- this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation, ' -> isOpenInfoConversation ', this.isOpenInfoConversation)
504
+ this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation)
509
505
  } else {
510
506
  this.logger.log('[CONVS-DETAIL] - initialize -> checkWindowWidthIsLessThan991px ', checkWindowWidthIsLessThan991px())
511
507
  this.openInfoConversation = true
512
- this.isOpenInfoConversation = true
513
- this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation, ' -> isOpenInfoConversation ', this.isOpenInfoConversation)
508
+ this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation)
514
509
  }
515
510
  }
516
511
 
@@ -529,6 +524,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
529
524
  this.addEventsKeyboard()
530
525
  this.startConversation()
531
526
  this.updateConversationBadge() // AGGIORNO STATO DELLA CONVERSAZIONE A 'LETTA' (is_new = false)
527
+
528
+ this.initializeTyping();
532
529
  }
533
530
 
534
531
  _getProjectIdByConversationWith(conversationWith: string) {
@@ -563,22 +560,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
563
560
  })
564
561
  }
565
562
 
566
- returnOpenCloseInfoConversation(openInfoConversation: boolean) {
567
- this.logger.log('[CONVS-DETAIL] returnOpenCloseInfoConversation - openInfoConversation ', openInfoConversation)
568
- this.resizeTextArea()
569
- this.openInfoMessage = false
570
- this.openInfoConversation = openInfoConversation
571
- this.isOpenInfoConversation = openInfoConversation
572
- this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
573
- }
574
-
575
563
  @HostListener('window:resize', ['$event'])
576
564
  onResize(event: any) {
577
565
  const newInnerWidth = event.target.innerWidth
578
566
  if (newInnerWidth < 991) {
579
567
  if (this.USER_HAS_OPENED_CLOSE_INFO_CONV === false) {
580
568
  this.openInfoConversation = false
581
- this.isOpenInfoConversation = false
582
569
  }
583
570
  }
584
571
  }
@@ -597,7 +584,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
597
584
  'LABEL_TO',
598
585
  'LABEL_LAST_ACCESS',
599
586
  'ARRAY_DAYS',
600
- 'LABEL_IS_WRITING',
587
+
601
588
  'LABEL_INFO_ADVANCED',
602
589
  'ID_CONVERSATION',
603
590
  'UPLOAD_FILE_ERROR',
@@ -616,11 +603,35 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
616
603
  'THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE',
617
604
  'TO_CREATE_THEM_GO_TO_THE_PROJECT',
618
605
  "AddNewCannedResponse",
619
- "LABEL_LOADING"
606
+ "LABEL_LOADING",
607
+ "DIRECT_CHAT",
608
+ "GROUP_CHAT",
620
609
  ]
621
610
 
622
- this.translationMap = this.customTranslateService.translateLanguage(keys)
623
- this.logger.log('[CONVS-DETAIL] x this.translationMap ',this.translationMap)
611
+ const keysHeader = [
612
+ 'DIRECT_CHAT',
613
+ 'GROUP_CHAT',
614
+ 'LABEL_IS_WRITING',
615
+ 'LABEL_AVAILABLE',
616
+ 'LABEL_NOT_AVAILABLE',
617
+ 'LABEL_INACTIVE',
618
+ 'LABEL_TODAY',
619
+ 'LABEL_TOMORROW',
620
+ 'LABEL_TO',
621
+ 'LABEL_LAST_ACCESS',
622
+ 'ARRAY_DAYS',
623
+ ]
624
+
625
+ const keysContentDetail = [
626
+ 'LABEL_OPEN_INFO_CONVERSATION',
627
+ 'LABEL_CLOSE_GROUP',
628
+ 'LABEL_IS_WRITING',
629
+ ]
630
+
631
+ this.translationsMap = this.customTranslateService.translateLanguage(keys)
632
+ this.translationsHeaderMap = this.customTranslateService.translateLanguage(keysHeader)
633
+ this.translationsContentMap = this.customTranslateService.translateLanguage(keysContentDetail)
634
+ this.logger.log('[CONVS-DETAIL] x this.translationMap ',this.translationsMap)
624
635
  }
625
636
 
626
637
  // --------------------------------------------------------
@@ -647,6 +658,13 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
647
658
  return this.customTranslateService.translateLanguage(keys)
648
659
  }
649
660
 
661
+ private setStyleMap(){
662
+ this.styleMap.set('themeColor', 'var(--basic-gray)')
663
+ .set('bubbleReceivedBackground','var(--bck-msg-received)')
664
+ .set('bubbleReceivedTextColor', 'var(--col-msg-received)')
665
+ .set('bubbleSentBackground', 'var(--bck-msg-sent)')
666
+ .set('bubbleSentTextColor', 'var(--col-msg-sent)')
667
+ }
650
668
  // -------------------------------------------------------------------------------------
651
669
  // * retrieving the handler from chatManager
652
670
  // * if it DOESN'T EXIST I create a handler and connect and store it in the chatmanager
@@ -749,6 +767,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
749
767
  conv.conversation_with,
750
768
  conv.conversation_with_fullname,
751
769
  conv.channel_type,
770
+ conv.attributes['projectId'],
771
+ conv.attributes['project_name']
752
772
  )
753
773
  }
754
774
  if(!conv){
@@ -761,6 +781,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
761
781
  conv.conversation_with,
762
782
  conv.conversation_with_fullname,
763
783
  conv.channel_type,
784
+ conv.attributes['projectId'],
785
+ conv.attributes['project_name']
764
786
  )
765
787
  let duration = getDateDifference(conv.timestamp, Date.now())
766
788
  duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
@@ -779,6 +801,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
779
801
  conv.conversation_with,
780
802
  conv.conversation_with_fullname,
781
803
  conv.channel_type,
804
+ conv.attributes['projectId'],
805
+ conv.attributes['project_name']
782
806
  )
783
807
  let duration = getDateDifference(conv.timestamp, Date.now())
784
808
  duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
@@ -790,6 +814,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
790
814
  conv.conversation_with,
791
815
  conv.conversation_with_fullname,
792
816
  conv.channel_type,
817
+ conv.attributes['projectId'],
818
+ conv.attributes['project_name']
793
819
  )
794
820
  }
795
821
  this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar)
@@ -977,6 +1003,22 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
977
1003
  this.subscriptions.push(subscribe)
978
1004
  }
979
1005
 
1006
+ subscriptionKey = 'conversationTyping';
1007
+ subscription = this.subscriptions.find(item => item.key === subscriptionKey);
1008
+ if (!subscription) {
1009
+ subscription = this.typingService.BSIsTyping.pipe(takeUntil(this.unsubscribe$)).subscribe((data: any) => {
1010
+ this.logger.debug('[CONVS-DETAIL] ***** BSIsTyping *****', data);
1011
+ if (data) {
1012
+ const isTypingUid = data.uid; //support-group-...
1013
+ if (this.conversationWith === isTypingUid) {
1014
+ that.subscribeTypings(data);
1015
+ }
1016
+ }
1017
+ });
1018
+ const subscribe = {key: subscriptionKey, value: subscription };
1019
+ this.subscriptions.push(subscribe);
1020
+ }
1021
+
980
1022
  // subscriptionKey = 'onGroupChange';
981
1023
  // subscription = this.subscriptions.find(item => item.key === subscriptionKey);
982
1024
  // if (!subscription) {
@@ -1024,7 +1066,9 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1024
1066
  this.conversationAvatar = setConversationAvatar(
1025
1067
  this.conversationWith,
1026
1068
  this.conversationWithFullname,
1027
- this.channelType
1069
+ this.channelType,
1070
+ this.conversation.attributes['projectId'],
1071
+ this.conversation.attributes['project_name']
1028
1072
  )
1029
1073
 
1030
1074
  }
@@ -1147,7 +1191,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1147
1191
  setTimeout(() => {
1148
1192
  if (this.conversationWith.startsWith('support-group')) {
1149
1193
  const pos = message.lastIndexOf('/')
1150
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea - canned responses pos of / (using lastIndexOf) ', pos)
1194
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea - canned responses pos of / (using lastIndexOf) ', message, pos)
1151
1195
 
1152
1196
  if (pos === -1) {
1153
1197
  // this.tagsCannedFilter = []
@@ -1172,7 +1216,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1172
1216
  // --------------------------------------------
1173
1217
  // Load canned responses
1174
1218
  // --------------------------------------------
1175
- this.HIDE_CANNED_RESPONSES = false
1219
+ // this.HIDE_CANNED_RESPONSES = false
1176
1220
  this.messageStr = strSearch
1177
1221
  // ------------------------------------------------------------------------------------------------------------------------------------------
1178
1222
  // Hide / display Canned when the SLASH has POSITION POS 0 and checking if there is a space after the SLASH (in this case it will be hidden)
@@ -1201,13 +1245,17 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1201
1245
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash', beforeSlash)
1202
1246
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash', afterSlash)
1203
1247
 
1248
+ console.log('bbbbbbb', beforeSlash[beforeSlash.length-1].indexOf(' '), afterSlash === '', this.HIDE_CANNED_RESPONSES)
1204
1249
 
1205
- if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash[0] === ''){
1250
+ if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ''){
1206
1251
  this.HIDE_CANNED_RESPONSES = false
1207
- } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') < 0 && afterSlash[0] === '' ){
1252
+ console.log('bbbbbbb 1111', beforeSlash[beforeSlash.length-1])
1253
+ } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') < 0 && afterSlash === '' ){
1208
1254
  this.HIDE_CANNED_RESPONSES = true
1209
- } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash[0] === ' '){
1255
+ console.log('bbbbbbb 22222', beforeSlash[beforeSlash.length-1])
1256
+ } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ' '){
1210
1257
  this.HIDE_CANNED_RESPONSES = true
1258
+ console.log('bbbbbbb 33333', beforeSlash[beforeSlash.length-1])
1211
1259
  // this.tagsCannedFilter = []
1212
1260
  }
1213
1261
  }
@@ -1497,6 +1545,13 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1497
1545
  }
1498
1546
  }
1499
1547
 
1548
+ onOpenCloseInfoConversation(event){
1549
+ this.logger.log('[CONVS-DETAIL] onOpenCloseInfoConversation - openInfoConversation ', event)
1550
+ this.resizeTextArea()
1551
+ this.openInfoConversation = event
1552
+ this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
1553
+ }
1554
+
1500
1555
  // -------------- START SCROLL/RESIZE -------------- //
1501
1556
  /** */
1502
1557
  resizeTextArea() {
@@ -1598,6 +1653,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1598
1653
  this.heightMessageTextArea = '57' // NK edited
1599
1654
  }
1600
1655
  }
1656
+
1601
1657
  checkAcceptedFile(draggedFileMimeType) {
1602
1658
  let isAcceptFile = false
1603
1659
  this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept: ',this.appConfigProvider.getConfig().fileUploadAccept)
@@ -1647,6 +1703,63 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1647
1703
  return isAcceptFile
1648
1704
  }
1649
1705
  }
1706
+
1707
+
1708
+ initializeTyping() {
1709
+ this.logger.debug('[CONVS-DETAIL] membersconversation', this.membersConversation)
1710
+ this.membersConversation.push(this.loggedUser.uid)
1711
+ //this.setSubscriptions();
1712
+ this.typingService.isTyping(this.conversationWith, this.loggedUser.uid, this.isDirect);
1713
+
1714
+ }
1715
+
1716
+ /** */
1717
+ subscribeTypings(data: any) {
1718
+ const that = this;
1719
+ try {
1720
+ const key = data.uidUserTypingNow;
1721
+ const waitTime = data.waitTime
1722
+ this.nameUserTypingNow = null;
1723
+ this.idUserTypingNow = null;
1724
+
1725
+ if (data.nameUserTypingNow) {
1726
+ this.nameUserTypingNow = data.nameUserTypingNow;
1727
+ }
1728
+ if (data.uidUserTypingNow){
1729
+ this.idUserTypingNow = data.uidUserTypingNow
1730
+ }
1731
+ this.logger.debug('[CONV-COMP] subscribeTypings data:', data);
1732
+ const userTyping = this.membersConversation.includes(key);
1733
+ if ( !userTyping && key) {
1734
+ this.isTypings = true;
1735
+ setTimeout(function () {
1736
+ that.scrollBottom(0)
1737
+ }, 0);
1738
+ // clearTimeout(this.setTimeoutWritingMessages);
1739
+ this.setTimeoutWritingMessages = setTimeout(() => {
1740
+ that.isTypings = false;
1741
+ }, waitTime);
1742
+ // this.initiTimeout(waitTime)
1743
+ }
1744
+ } catch (error) {
1745
+ this.logger.error('[CONV-COMP] error: ', error);
1746
+ }
1747
+
1748
+ }
1749
+
1750
+ initiTimeout(waitTime){
1751
+ const that = this;
1752
+ this.setTimeoutWritingMessages = setTimeout(() => {
1753
+ that.isTypings = false;
1754
+ }, waitTime);
1755
+ }
1756
+
1757
+ resetTimeout(){
1758
+ this.isTypings = false
1759
+ this.setTimeoutWritingMessages = null;
1760
+ clearTimeout(this.setTimeoutWritingMessages)
1761
+ }
1762
+
1650
1763
  // -------------------------------------------------------------
1651
1764
  // DRAG FILE
1652
1765
  // -------------------------------------------------------------
@@ -1706,7 +1819,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1706
1819
 
1707
1820
  async presentToastOnlyImageFilesAreAllowedToDrag() {
1708
1821
  const toast = await this.toastController.create({
1709
- message: this.translationMap.get('FAILED_TO_UPLOAD_THE_FORMAT_IS_NOT_SUPPORTED'),
1822
+ message: this.translationsMap.get('FAILED_TO_UPLOAD_THE_FORMAT_IS_NOT_SUPPORTED'),
1710
1823
  duration: 5000,
1711
1824
  color: 'danger',
1712
1825
  cssClass: 'toast-custom-class',