diff --git a/src/app/layout/common/quick-chat/quick-chat.component.ts b/src/app/layout/common/quick-chat/quick-chat.component.ts index f6ee0bba..e7b33f9b 100644 --- a/src/app/layout/common/quick-chat/quick-chat.component.ts +++ b/src/app/layout/common/quick-chat/quick-chat.component.ts @@ -1,9 +1,9 @@ import { Component, ElementRef, HostBinding, HostListener, NgZone, OnDestroy, OnInit, Renderer2, ViewChild, ViewEncapsulation } from '@angular/core'; +import { ScrollStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { Chat } from 'app/modules/admin/apps/chat/chat.types'; import { QuickChatService } from 'app/layout/common/quick-chat/quick-chat.service'; -import { ScrollStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay'; +import { Chat } from 'app/layout/common/quick-chat/quick-chat.types'; @Component({ selector : 'quick-chat', diff --git a/src/app/layout/common/quick-chat/quick-chat.service.ts b/src/app/layout/common/quick-chat/quick-chat.service.ts index 20fa343c..fe5cdfc1 100644 --- a/src/app/layout/common/quick-chat/quick-chat.service.ts +++ b/src/app/layout/common/quick-chat/quick-chat.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { BehaviorSubject, Observable, of, throwError } from 'rxjs'; import { map, switchMap, tap } from 'rxjs/operators'; -import { Chat } from 'app/modules/admin/apps/chat/chat.types'; +import { Chat } from 'app/layout/common/quick-chat/quick-chat.types'; @Injectable({ providedIn: 'root' diff --git a/src/app/layout/common/quick-chat/quick-chat.types.ts b/src/app/layout/common/quick-chat/quick-chat.types.ts index 4d9d25de..daf57bc3 100644 --- a/src/app/layout/common/quick-chat/quick-chat.types.ts +++ b/src/app/layout/common/quick-chat/quick-chat.types.ts @@ -1,3 +1,5 @@ +import { Contact } from 'app/modules/admin/apps/chat/chat.types'; + export interface Notification { id: string; @@ -10,3 +12,22 @@ export interface Notification useRouter?: boolean; read: boolean; } + +export interface Chat +{ + id?: string; + contactId?: string; + contact?: Contact; + unreadCount?: number; + muted?: boolean; + lastMessage?: string; + lastMessageAt?: string; + messages?: { + id?: string; + chatId?: string; + contactId?: string; + isMine?: boolean; + value?: string; + createdAt?: string; + }[]; +}