bulbul-chat
Advanced tools
Comparing version 2.5.0 to 2.5.1
@@ -99,4 +99,5 @@ "use strict"; | ||
var useChannelData = function (channelExternalId, chatService) { | ||
var _a = react_1.default.useReducer(reducer, initialState), state = _a[0], dispatch = _a[1]; | ||
var _b = react_1.default.useState([]), currentUnsubscriptions = _b[0], setCurrentUnsubscriptions = _b[1]; | ||
var _a, _b; | ||
var _c = react_1.default.useReducer(reducer, initialState), state = _c[0], dispatch = _c[1]; | ||
var _d = react_1.default.useState([]), currentUnsubscriptions = _d[0], setCurrentUnsubscriptions = _d[1]; | ||
var loadEarlier = react_1.useCallback(function () { | ||
@@ -234,4 +235,11 @@ if (state.channel) | ||
checkTypingUsers(); | ||
return function () { return clearInterval(intervalId); }; | ||
}, [state.channel]); | ||
return function () { | ||
clearInterval(intervalId); | ||
}; | ||
}, [ | ||
(_b = (_a = state.channel) === null || _a === void 0 ? void 0 : _a.channelMemberships) === null || _b === void 0 ? void 0 : _b.filter(function (memberShip) { | ||
return memberShip.lastActingAt && | ||
utils_1.diffInSeconds(new Date(), new Date(memberShip.lastActingAt)) < 20; | ||
}).length, | ||
]); | ||
return [state, loadEarlier, loadLater]; | ||
@@ -238,0 +246,0 @@ }; |
{ | ||
"name": "bulbul-chat", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -195,6 +195,14 @@ import { diffInSeconds } from './utils'; | ||
checkTypingUsers(); | ||
return () => clearInterval(intervalId); | ||
}, [state.channel]); | ||
return () => { | ||
clearInterval(intervalId); | ||
}; | ||
}, [ | ||
state.channel?.channelMemberships?.filter( | ||
(memberShip) => | ||
memberShip.lastActingAt && | ||
diffInSeconds(new Date(), new Date(memberShip.lastActingAt)) < 20 | ||
).length, | ||
]); | ||
return [state, loadEarlier, loadLater]; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
215005
3913