diff --git a/electron-projects/ucap-webmessenger-electron/src/index.ts b/electron-projects/ucap-webmessenger-electron/src/index.ts index 1ae23473..2734a605 100644 --- a/electron-projects/ucap-webmessenger-electron/src/index.ts +++ b/electron-projects/ucap-webmessenger-electron/src/index.ts @@ -549,10 +549,12 @@ ipcMain.on( if (!err) { event.returnValue = savePath; } else { + log.info('SaveFile err', err); event.returnValue = undefined; } }); } catch (error) { + log.info('SaveFile error', error); event.returnValue = undefined; } } diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts index 8c645c5c..163eb95f 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts @@ -82,7 +82,7 @@ export const reducer = createReducer( // tslint:disable-next-line: forin for (const key in state.room.entities) { const value = state.room.entities[key]; - unReadCount += value.noReadCnt; + unReadCount += isNaN(value.noReadCnt) ? 0 : value.noReadCnt; } action.roomList.map(item => (unReadCount += item.noReadCnt)); @@ -304,7 +304,7 @@ export const reducer = createReducer( for (const key in state.room.entities) { if (key !== action.roomSeq) { const value = state.room.entities[key]; - unReadCount += value.noReadCnt; + unReadCount += isNaN(value.noReadCnt) ? 0 : value.noReadCnt; } } } else { diff --git a/projects/ucap-webmessenger-protocol-room/src/lib/protocols/info.ts b/projects/ucap-webmessenger-protocol-room/src/lib/protocols/info.ts index 85622e51..9d76f066 100644 --- a/projects/ucap-webmessenger-protocol-room/src/lib/protocols/info.ts +++ b/projects/ucap-webmessenger-protocol-room/src/lib/protocols/info.ts @@ -89,7 +89,7 @@ export const decodeInfoData: ProtocolDecoder = ( finalEventMessage: info[4], finalEventDate: info[5], joinUserCount: Number(info[6]), - noReadCnt: Number(info[7]), + noReadCnt: isNaN(info[7]) ? 0 : Number(info[7]), receiveAlarm: info[8] !== 'N' ? true : false, isJoinRoom: info[9] === 'Y' ? true : false, expiredFileStdSeq: Number(info[10]), diff --git a/projects/ucap-webmessenger-protocol-sync/src/lib/protocols/room.ts b/projects/ucap-webmessenger-protocol-sync/src/lib/protocols/room.ts index 02e5dd76..97a80292 100644 --- a/projects/ucap-webmessenger-protocol-sync/src/lib/protocols/room.ts +++ b/projects/ucap-webmessenger-protocol-sync/src/lib/protocols/room.ts @@ -83,7 +83,7 @@ export const decodeRoomData: ProtocolDecoder = ( finalEventMessage: info[4], finalEventDate: info[5], joinUserCount: Number(info[6]), - noReadCnt: Number(info[7]), + noReadCnt: isNaN(info[7]) ? 0 : Number(info[7]), receiveAlarm: info[8] !== 'N' ? true : false, isJoinRoom: info[9] === 'Y' ? true : false, expiredFileStdSeq: Number(info[10]), diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts index aa5608b5..9f481c02 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts @@ -178,6 +178,13 @@ export class MessagesComponent implements OnInit, OnDestroy { this.loginRes = loginRes; }); this.roomInfoSubscription = this.roomInfo$.subscribe(roomInfo => { + if ( + !this.roomInfo || + (!!this.roomInfo && this.roomInfo.roomSeq !== roomInfo.roomSeq) + ) { + this.baseEventSeq = 0; + } + this.roomInfo = roomInfo; this.showMore = false; @@ -196,7 +203,6 @@ export class MessagesComponent implements OnInit, OnDestroy { !this.roomInfo || (!!this.roomInfo && this.roomInfo.roomSeq !== roomInfo.roomSeq) ) { - this.baseEventSeq = 0; this.initEventMore(); } });