1. 다른디바이스와의 Sync 처리. ::: EVENT_RES, EVENT_READ_RES

2. 대화리스트의 finalEventMessage 갱신되지 않는 문제 수정 :: virture scroll 처리 제거.
This commit is contained in:
leejh 2019-10-29 10:10:08 +09:00
parent 266f690ea3
commit eb0f86578d
7 changed files with 61 additions and 15 deletions

View File

@ -1,6 +1,10 @@
import { JsonObject } from 'type-fest'; import { JsonObject } from 'type-fest';
export class JsonAnalization { export class JsonAnalization {
/**
* Raw string Analization for JSON string.
* @description Editing with string.util.ts
*/
public static receiveAnalization(jsonStr: string): JsonObject { public static receiveAnalization(jsonStr: string): JsonObject {
const startJson = jsonStr.indexOf('{'); const startJson = jsonStr.indexOf('{');
const endJson = jsonStr.lastIndexOf('}'); const endJson = jsonStr.lastIndexOf('}');

View File

@ -21,7 +21,17 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div class="app-layout-chat-left-sidenav-chat-list" perfectScrollbar> <div class="app-layout-chat-left-sidenav-chat-list" perfectScrollbar>
<cdk-virtual-scroll-viewport <ucap-room-list-item
*ngFor="let room of getRoomList()"
[loginRes]="loginRes"
[roomInfo]="room"
[roomUserInfo]="getRoomUserList(room)"
[sessionVerinfo]="sessionVerinfo"
(click)="onSelectedRoom(room)"
(contextmenu)="onContextMenuChat($event, room)"
>
</ucap-room-list-item>
<!-- <cdk-virtual-scroll-viewport
itemSize="20" itemSize="20"
class="app-layout-chat-left-sidenav-chat-list-viewport" class="app-layout-chat-left-sidenav-chat-list-viewport"
> >
@ -35,7 +45,7 @@
(contextmenu)="onContextMenuChat($event, room)" (contextmenu)="onContextMenuChat($event, room)"
> >
</ucap-room-list-item> </ucap-room-list-item>
</cdk-virtual-scroll-viewport> </cdk-virtual-scroll-viewport> -->
</div> </div>
<div <div

View File

@ -20,7 +20,9 @@ import {
SSVC_TYPE_EVENT_READ_NOTI, SSVC_TYPE_EVENT_READ_NOTI,
SSVC_TYPE_EVENT_CANCEL_NOTI, SSVC_TYPE_EVENT_CANCEL_NOTI,
SSVC_TYPE_EVENT_DEL_RES, SSVC_TYPE_EVENT_DEL_RES,
Info Info,
SSVC_TYPE_EVENT_SEND_RES,
SSVC_TYPE_EVENT_READ_RES
} from '@ucap-webmessenger/protocol-event'; } from '@ucap-webmessenger/protocol-event';
import { import {
InfoProtocolService, InfoProtocolService,
@ -104,6 +106,7 @@ export class AppNotificationService {
.pipe( .pipe(
tap(notiOrRes => { tap(notiOrRes => {
switch (notiOrRes.SSVC_TYPE) { switch (notiOrRes.SSVC_TYPE) {
case SSVC_TYPE_EVENT_SEND_RES:
case SSVC_TYPE_EVENT_SEND_NOTI: case SSVC_TYPE_EVENT_SEND_NOTI:
{ {
const noti = notiOrRes as SendNotification; const noti = notiOrRes as SendNotification;
@ -119,6 +122,7 @@ export class AppNotificationService {
); );
} }
break; break;
case SSVC_TYPE_EVENT_READ_RES:
case SSVC_TYPE_EVENT_READ_NOTI: case SSVC_TYPE_EVENT_READ_NOTI:
{ {
// 대화방 unread count 처리. // 대화방 unread count 처리.

View File

@ -39,6 +39,8 @@ export const newInfo = createAction(
props<{ props<{
roomSeq: string; roomSeq: string;
info: Info; info: Info;
SVC_TYPE?: number;
SSVC_TYPE?: number;
}>() }>()
); );

View File

@ -25,6 +25,7 @@ import {
Info, Info,
InfoResponse, InfoResponse,
EventProtocolService, EventProtocolService,
SVC_TYPE_EVENT,
SSVC_TYPE_EVENT_INFO_DATA, SSVC_TYPE_EVENT_INFO_DATA,
SSVC_TYPE_EVENT_INFO_RES, SSVC_TYPE_EVENT_INFO_RES,
SendResponse, SendResponse,
@ -207,7 +208,12 @@ export class Effects {
}; };
this.store.dispatch( this.store.dispatch(
newInfo({ roomSeq: res.roomSeq, info: appendInfo }) newInfo({
roomSeq: res.roomSeq,
info: appendInfo,
SVC_TYPE: res.SVC_TYPE,
SSVC_TYPE: res.SSVC_TYPE
})
); );
}) })
); );
@ -231,7 +237,12 @@ export class Effects {
}; };
this.store.dispatch( this.store.dispatch(
newInfo({ roomSeq: noti.roomSeq, info: appendInfo }) newInfo({
roomSeq: noti.roomSeq,
info: appendInfo,
SVC_TYPE: noti.SVC_TYPE,
SSVC_TYPE: noti.SSVC_TYPE
})
); );
}) })
); );
@ -368,6 +379,15 @@ export class Effects {
} }
// not opened room :: unread count increased // not opened room :: unread count increased
if (
action.SVC_TYPE === SVC_TYPE_EVENT &&
action.SSVC_TYPE === SSVC_TYPE_EVENT_INFO_RES
) {
/**
* RES noti .
* unread count .
*/
} else {
if (!roomInfo || roomInfo.roomSeq !== action.roomSeq) { if (!roomInfo || roomInfo.roomSeq !== action.roomSeq) {
if (!!trgtRoomInfos && !!trgtRoomInfos[action.roomSeq]) { if (!!trgtRoomInfos && !!trgtRoomInfos[action.roomSeq]) {
const noReadCnt = trgtRoomInfos[action.roomSeq].noReadCnt; const noReadCnt = trgtRoomInfos[action.roomSeq].noReadCnt;
@ -379,6 +399,7 @@ export class Effects {
); );
} }
} }
}
// 대화 > 리스트 :: finalEventMessage refresh // 대화 > 리스트 :: finalEventMessage refresh
this.store.dispatch(ChatStore.newEventMessage(action)); this.store.dispatch(ChatStore.newEventMessage(action));

View File

@ -34,7 +34,9 @@ import {
SSVC_TYPE_EVENT_CANCEL_NOTI, SSVC_TYPE_EVENT_CANCEL_NOTI,
SSVC_TYPE_EVENT_SEND_NOTI, SSVC_TYPE_EVENT_SEND_NOTI,
SSVC_TYPE_EVENT_READ_NOTI, SSVC_TYPE_EVENT_READ_NOTI,
SSVC_TYPE_EVENT_DEL_RES SSVC_TYPE_EVENT_DEL_RES,
SSVC_TYPE_EVENT_SEND_RES,
SSVC_TYPE_EVENT_READ_RES
} from '../types/service'; } from '../types/service';
import { import {
SendRequest, SendRequest,
@ -92,11 +94,13 @@ export class EventProtocolService {
filter(message => message.serviceType === SVC_TYPE_EVENT), filter(message => message.serviceType === SVC_TYPE_EVENT),
tap(message => { tap(message => {
switch (message.subServiceType) { switch (message.subServiceType) {
case SSVC_TYPE_EVENT_SEND_RES:
case SSVC_TYPE_EVENT_SEND_NOTI: case SSVC_TYPE_EVENT_SEND_NOTI:
{ {
this.notificationSubject.next(decodeSendNotification(message)); this.notificationSubject.next(decodeSendNotification(message));
} }
break; break;
case SSVC_TYPE_EVENT_READ_RES:
case SSVC_TYPE_EVENT_READ_NOTI: case SSVC_TYPE_EVENT_READ_NOTI:
{ {
this.notificationSubject.next(decodeReadNotification(message)); this.notificationSubject.next(decodeReadNotification(message));

View File

@ -37,6 +37,7 @@ export class StringUtil {
/** /**
* Json String Analization. * Json String Analization.
* @description Editing with json.util.ts
*/ */
public static receiveAnalization(jsonStr: string): JsonObject { public static receiveAnalization(jsonStr: string): JsonObject {
const startJson = jsonStr.indexOf('{'); const startJson = jsonStr.indexOf('{');