This commit is contained in:
leejinho 2020-02-12 15:21:29 +09:00
parent ecb7eb5f2f
commit d9d17f8c2a
5 changed files with 13 additions and 5 deletions

View File

@ -549,10 +549,12 @@ ipcMain.on(
if (!err) { if (!err) {
event.returnValue = savePath; event.returnValue = savePath;
} else { } else {
log.info('SaveFile err', err);
event.returnValue = undefined; event.returnValue = undefined;
} }
}); });
} catch (error) { } catch (error) {
log.info('SaveFile error', error);
event.returnValue = undefined; event.returnValue = undefined;
} }
} }

View File

@ -82,7 +82,7 @@ export const reducer = createReducer(
// tslint:disable-next-line: forin // tslint:disable-next-line: forin
for (const key in state.room.entities) { for (const key in state.room.entities) {
const value = state.room.entities[key]; const value = state.room.entities[key];
unReadCount += value.noReadCnt; unReadCount += isNaN(value.noReadCnt) ? 0 : value.noReadCnt;
} }
action.roomList.map(item => (unReadCount += item.noReadCnt)); action.roomList.map(item => (unReadCount += item.noReadCnt));
@ -304,7 +304,7 @@ export const reducer = createReducer(
for (const key in state.room.entities) { for (const key in state.room.entities) {
if (key !== action.roomSeq) { if (key !== action.roomSeq) {
const value = state.room.entities[key]; const value = state.room.entities[key];
unReadCount += value.noReadCnt; unReadCount += isNaN(value.noReadCnt) ? 0 : value.noReadCnt;
} }
} }
} else { } else {

View File

@ -89,7 +89,7 @@ export const decodeInfoData: ProtocolDecoder<InfoData> = (
finalEventMessage: info[4], finalEventMessage: info[4],
finalEventDate: info[5], finalEventDate: info[5],
joinUserCount: Number(info[6]), joinUserCount: Number(info[6]),
noReadCnt: Number(info[7]), noReadCnt: isNaN(info[7]) ? 0 : Number(info[7]),
receiveAlarm: info[8] !== 'N' ? true : false, receiveAlarm: info[8] !== 'N' ? true : false,
isJoinRoom: info[9] === 'Y' ? true : false, isJoinRoom: info[9] === 'Y' ? true : false,
expiredFileStdSeq: Number(info[10]), expiredFileStdSeq: Number(info[10]),

View File

@ -83,7 +83,7 @@ export const decodeRoomData: ProtocolDecoder<RoomData> = (
finalEventMessage: info[4], finalEventMessage: info[4],
finalEventDate: info[5], finalEventDate: info[5],
joinUserCount: Number(info[6]), joinUserCount: Number(info[6]),
noReadCnt: Number(info[7]), noReadCnt: isNaN(info[7]) ? 0 : Number(info[7]),
receiveAlarm: info[8] !== 'N' ? true : false, receiveAlarm: info[8] !== 'N' ? true : false,
isJoinRoom: info[9] === 'Y' ? true : false, isJoinRoom: info[9] === 'Y' ? true : false,
expiredFileStdSeq: Number(info[10]), expiredFileStdSeq: Number(info[10]),

View File

@ -178,6 +178,13 @@ export class MessagesComponent implements OnInit, OnDestroy {
this.loginRes = loginRes; this.loginRes = loginRes;
}); });
this.roomInfoSubscription = this.roomInfo$.subscribe(roomInfo => { this.roomInfoSubscription = this.roomInfo$.subscribe(roomInfo => {
if (
!this.roomInfo ||
(!!this.roomInfo && this.roomInfo.roomSeq !== roomInfo.roomSeq)
) {
this.baseEventSeq = 0;
}
this.roomInfo = roomInfo; this.roomInfo = roomInfo;
this.showMore = false; this.showMore = false;
@ -196,7 +203,6 @@ export class MessagesComponent implements OnInit, OnDestroy {
!this.roomInfo || !this.roomInfo ||
(!!this.roomInfo && this.roomInfo.roomSeq !== roomInfo.roomSeq) (!!this.roomInfo && this.roomInfo.roomSeq !== roomInfo.roomSeq)
) { ) {
this.baseEventSeq = 0;
this.initEventMore(); this.initEventMore();
} }
}); });