Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Panico committed Nov 4, 2024
1 parent 3786ce1 commit 8ce56fb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
32 changes: 19 additions & 13 deletions src/app/pages/conversation-detail/conversation-detail.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,17 +539,23 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit

_getProjectIdByConversationWith(conversationWith: string) {
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationWith).subscribe((res) => {
this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT RES + projectId', res, res.id_project)
if (res) {
const projectId = res.id_project
this.getProjectById(tiledeskToken, projectId)
}
}, (error) => {
this.logger.error('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT - ERROR ', error)
}, () => {
this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *',)
})
if (this.channelType !== TYPE_DIRECT && !this.conversationWith.startsWith('group-')) {
this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationWith).subscribe((res) => {
this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT RES + projectId', res, res.id_project)
if (res) {
const projectId = res.id_project
this.getProjectById(tiledeskToken, projectId)
}
}, (error) => {
this.logger.error('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT - ERROR ',conversationWith, error)
}, () => {
this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *',)
})
}else {
this.canShowCanned = false;
this.offlineMsgEmail = false;
}

}

getProjectById(tiledeskToken, projectId) {
Expand Down Expand Up @@ -905,7 +911,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
this.archivedConversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
this.logger.debug('[CONV-COMP] setHeaderContent getConversationDetail: archivedConversationsHandlerService', this.conversationWith, conv)
if (conv) {
console.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (archived)', this.conversationWith, 'CONVS', conv)
this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (archived)', this.conversationWith, 'CONVS', conv)
this.conversation = this.onConversationLoaded(conv)
this.conversationAvatar = setConversationAvatar(
conv.conversation_with,
Expand Down Expand Up @@ -972,7 +978,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit

getLeadDetail() {
const that = this;
if (this.channelType !== TYPE_DIRECT && this.channelType !== TYPE_GROUP) {
if (this.channelType !== TYPE_DIRECT && !this.conversationWith.startsWith('group-')) {
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
const projectId = getProjectIdSelectedConversation(this.conversationWith)
this.logger.debug('[CONVS-DETAIL] getLeadDetail - section ', projectId)
Expand Down
3 changes: 2 additions & 1 deletion src/chat21-core/providers/mqtt/mqtt-groups-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user
this.logger.log('Method not implemented.');
return;
}
// abstract onGroupChange(groupId: string): Observable<GroupModel>;

// abstract onGroupChange(groupId: string): Observable<GroupModel>;
onGroupChange(groupId: string): Observable<GroupModel> {
if (this.isGroup(groupId)) {
this.chat21Service.chatClient.groupData(groupId, (err, group) => {
Expand Down

0 comments on commit 8ce56fb

Please sign in to comment.