Chat: fix type check in logs
This commit is contained in:
@@ -65,10 +65,7 @@ export class MessagesEventBus {
|
|||||||
const handle = (event: MessagesEventBusEvent) => {
|
const handle = (event: MessagesEventBusEvent) => {
|
||||||
if (event.type === 'logs' && options.convoId) {
|
if (event.type === 'logs' && options.convoId) {
|
||||||
const filteredLogs = event.logs.filter(log => {
|
const filteredLogs = event.logs.filter(log => {
|
||||||
if (
|
if ('convoId' in log && log.convoId === options.convoId) {
|
||||||
typeof log.convoId === 'string' &&
|
|
||||||
log.convoId === options.convoId
|
|
||||||
) {
|
|
||||||
return log.convoId === options.convoId
|
return log.convoId === options.convoId
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@@ -355,7 +352,7 @@ export class MessagesEventBus {
|
|||||||
* If there's a rev, we should handle it. If there's not a rev, we don't
|
* If there's a rev, we should handle it. If there's not a rev, we don't
|
||||||
* know what it is.
|
* know what it is.
|
||||||
*/
|
*/
|
||||||
if (typeof ev.rev === 'string') {
|
if ('rev' in ev) {
|
||||||
/*
|
/*
|
||||||
* We only care about new events
|
* We only care about new events
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user