bulbul-chat
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -134,2 +134,12 @@ "use strict"; | ||
}); | ||
this.socket.on('markedAllAsRead', function (data) { | ||
var upsert = { | ||
unreadMessageCount: 0, | ||
channelMembership: data.updatedChannelMembership, | ||
}; | ||
_this.eventRegistry.emit('channelUpsert', { | ||
channelId: data.channelId, | ||
upsert: upsert, | ||
}); | ||
}); | ||
// | ||
@@ -136,0 +146,0 @@ // Listen on IO events |
@@ -110,3 +110,2 @@ "use strict"; | ||
}, [state.channel, chatService]); | ||
console.log(state.unreadMessageCount, state.lastReadMessageId); | ||
// let websocket listen to channel messages and subscribe to new new messages | ||
@@ -170,2 +169,8 @@ react_1.default.useEffect(function () { | ||
}); | ||
dispatch({ | ||
type: 'update', | ||
channelId: _channel.id, | ||
chatService: chatService, | ||
channel: _channel, | ||
}); | ||
chatService.setCurrentChannel(_channel); | ||
@@ -172,0 +177,0 @@ chatService.markAllAsRead(_channel.id); |
{ | ||
"name": "bulbul-chat", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -167,2 +167,18 @@ import * as qs from 'qs'; | ||
}); | ||
this.socket.on( | ||
'markedAllAsRead', | ||
(data: { | ||
channelId: string; | ||
updatedChannelMembership: ChannelMembership; | ||
}) => { | ||
const upsert: ChatChannelUpsert = { | ||
unreadMessageCount: 0, | ||
channelMembership: data.updatedChannelMembership, | ||
}; | ||
this.eventRegistry.emit('channelUpsert', { | ||
channelId: data.channelId, | ||
upsert, | ||
}); | ||
} | ||
); | ||
@@ -169,0 +185,0 @@ // |
@@ -74,3 +74,2 @@ import { diffInSeconds } from './utils'; | ||
}, [state.channel, chatService]); | ||
console.log(state.unreadMessageCount, state.lastReadMessageId); | ||
// let websocket listen to channel messages and subscribe to new new messages | ||
@@ -130,2 +129,8 @@ React.useEffect(() => { | ||
}); | ||
dispatch({ | ||
type: 'update', | ||
channelId: _channel.id, | ||
chatService, | ||
channel: _channel, | ||
}); | ||
chatService.setCurrentChannel(_channel); | ||
@@ -132,0 +137,0 @@ chatService.markAllAsRead(_channel.id); |
143731
3515