stream-chat-react-native-core 5.24.0-beta.1 → 5.24.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +52 -18
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +4 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +31 -30
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +37 -35
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/i18n/fr.json +12 -12
- package/lib/commonjs/i18n/hi.json +12 -12
- package/lib/commonjs/i18n/it.json +12 -12
- package/lib/commonjs/i18n/nl.json +12 -12
- package/lib/commonjs/i18n/ru.json +12 -12
- package/lib/commonjs/i18n/tr.json +12 -12
- package/lib/commonjs/utils/utils.js +1 -3
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +52 -18
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +4 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/MessageList/MessageList.js +31 -30
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +37 -35
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/i18n/fr.json +12 -12
- package/lib/module/i18n/hi.json +12 -12
- package/lib/module/i18n/it.json +12 -12
- package/lib/module/i18n/nl.json +12 -12
- package/lib/module/i18n/ru.json +12 -12
- package/lib/module/i18n/tr.json +12 -12
- package/lib/module/utils/utils.js +1 -3
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreview.d.ts +1 -1
- package/lib/typescript/i18n/fr.json +12 -12
- package/lib/typescript/i18n/hi.json +12 -12
- package/lib/typescript/i18n/it.json +12 -12
- package/lib/typescript/i18n/nl.json +12 -12
- package/lib/typescript/i18n/ru.json +12 -12
- package/lib/typescript/i18n/tr.json +12 -12
- package/lib/typescript/utils/utils.d.ts +0 -1
- package/package.json +1 -1
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +6 -3
- package/src/components/ChannelPreview/ChannelPreview.tsx +5 -5
- package/src/components/MessageList/MessageList.tsx +11 -3
- package/src/contexts/messageInputContext/MessageInputContext.tsx +3 -2
- package/src/i18n/fr.json +12 -12
- package/src/i18n/hi.json +12 -12
- package/src/i18n/it.json +12 -12
- package/src/i18n/nl.json +12 -12
- package/src/i18n/ru.json +12 -12
- package/src/i18n/tr.json +12 -12
- package/src/utils/utils.ts +0 -2
- package/src/version.json +1 -1
|
@@ -199,9 +199,23 @@ var usePaginatedChannels = function usePaginatedChannels(_ref) {
|
|
|
199
199
|
return _ref3.apply(this, arguments);
|
|
200
200
|
};
|
|
201
201
|
}();
|
|
202
|
-
var reloadList = function
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
var reloadList = function () {
|
|
203
|
+
var _ref4 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3() {
|
|
204
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
205
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
206
|
+
case 0:
|
|
207
|
+
_context3.next = 2;
|
|
208
|
+
return queryChannels('reload');
|
|
209
|
+
case 2:
|
|
210
|
+
case "end":
|
|
211
|
+
return _context3.stop();
|
|
212
|
+
}
|
|
213
|
+
}, _callee3);
|
|
214
|
+
}));
|
|
215
|
+
return function reloadList() {
|
|
216
|
+
return _ref4.apply(this, arguments);
|
|
217
|
+
};
|
|
218
|
+
}();
|
|
205
219
|
var filterStr = (0, _react.useMemo)(function () {
|
|
206
220
|
return JSON.stringify(filters);
|
|
207
221
|
}, [filters]);
|
|
@@ -233,12 +247,32 @@ var usePaginatedChannels = function usePaginatedChannels(_ref) {
|
|
|
233
247
|
};
|
|
234
248
|
var listener;
|
|
235
249
|
if (enableOfflineSupport) {
|
|
236
|
-
listener = _DBSyncManager.DBSyncManager.onSyncStatusChange(function (
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
250
|
+
listener = _DBSyncManager.DBSyncManager.onSyncStatusChange(function () {
|
|
251
|
+
var _ref5 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4(syncStatus) {
|
|
252
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
253
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
254
|
+
case 0:
|
|
255
|
+
if (!syncStatus) {
|
|
256
|
+
_context4.next = 5;
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
loadOfflineChannels();
|
|
260
|
+
_context4.next = 4;
|
|
261
|
+
return reloadList();
|
|
262
|
+
case 4:
|
|
263
|
+
setForceUpdate(function (u) {
|
|
264
|
+
return u + 1;
|
|
265
|
+
});
|
|
266
|
+
case 5:
|
|
267
|
+
case "end":
|
|
268
|
+
return _context4.stop();
|
|
269
|
+
}
|
|
270
|
+
}, _callee4);
|
|
271
|
+
}));
|
|
272
|
+
return function (_x) {
|
|
273
|
+
return _ref5.apply(this, arguments);
|
|
274
|
+
};
|
|
275
|
+
}());
|
|
242
276
|
loadOfflineChannels();
|
|
243
277
|
var dbSyncStatus = _DBSyncManager.DBSyncManager.getSyncStatus();
|
|
244
278
|
if (dbSyncStatus) {
|
|
@@ -246,15 +280,15 @@ var usePaginatedChannels = function usePaginatedChannels(_ref) {
|
|
|
246
280
|
}
|
|
247
281
|
} else {
|
|
248
282
|
listener = client.on('connection.changed', function () {
|
|
249
|
-
var
|
|
250
|
-
return _regenerator["default"].wrap(function
|
|
251
|
-
while (1) switch (
|
|
283
|
+
var _ref6 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee5(event) {
|
|
284
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
285
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
252
286
|
case 0:
|
|
253
287
|
if (!event.online) {
|
|
254
|
-
|
|
288
|
+
_context5.next = 4;
|
|
255
289
|
break;
|
|
256
290
|
}
|
|
257
|
-
|
|
291
|
+
_context5.next = 3;
|
|
258
292
|
return refreshList();
|
|
259
293
|
case 3:
|
|
260
294
|
setForceUpdate(function (u) {
|
|
@@ -262,12 +296,12 @@ var usePaginatedChannels = function usePaginatedChannels(_ref) {
|
|
|
262
296
|
});
|
|
263
297
|
case 4:
|
|
264
298
|
case "end":
|
|
265
|
-
return
|
|
299
|
+
return _context5.stop();
|
|
266
300
|
}
|
|
267
|
-
},
|
|
301
|
+
}, _callee5);
|
|
268
302
|
}));
|
|
269
|
-
return function (
|
|
270
|
-
return
|
|
303
|
+
return function (_x2) {
|
|
304
|
+
return _ref6.apply(this, arguments);
|
|
271
305
|
};
|
|
272
306
|
}());
|
|
273
307
|
reloadList();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_ActiveChannelsRefContext","_ChatContext","_useIsMountedRef","_getChannelsForFilterSort","_date","_DBSyncManager","_utils","waitSeconds","seconds","Promise","resolve","setTimeout","ONE_SECOND_IN_MS","DEFAULT_OPTIONS","message_limit","MAX_NUMBER_OF_RETRIES","RETRY_INTERVAL_IN_MS","usePaginatedChannels","_ref","enableOfflineSupport","_ref$filters","filters","_ref$options","options","setForceUpdate","_ref$sort","sort","_useState","useState","_useState2","_slicedToArray2","channels","setChannels","_useState3","undefined","_useState4","error","setError","_useState5","_useState6","staticChannelsActive","setStaticChannelsActive","_useState7","_useState8","activeQueryType","setActiveQueryType","_useState9","_useState10","hasNextPage","setHasNextPage","activeChannels","useActiveChannelsRefContext","isMountedRef","useIsMountedRef","_useChatContext","useChatContext","client","filtersRef","useRef","sortRef","activeRequestId","isQueryingRef","lastRefresh","Date","now","queryChannels","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_options$limit","queryType","retryCount","hasUpdatedData","isQueryStale","currentRequestId","newOptions","channelQueryResponse","newChannels","_args","arguments","wrap","_callee$","_context","prev","next","length","current","abrupt","JSON","stringify","some","Boolean","_extends2","limit","MAX_QUERY_CHANNELS_LIMIT","offset","skipInitialization","sent","concat","_toConsumableArray2","map","c","existingChannel","cid","t0","console","warn","Error","stop","apply","refreshList","_ref3","_callee2","_callee2$","_context2","reloadList","filterStr","useMemo","sortStr","useEffect","loadOfflineChannels","_client$user","user","id","channelsFromDB","getChannelsForFilterSort","currentUserId","offlineChannels","hydrateActiveChannels","offlineMode","e","listener","DBSyncManager","onSyncStatusChange","syncStatus","dbSyncStatus","getSyncStatus","on","_ref4","_callee3","event","_callee3$","_context3","online","u","_x","_listener","unsubscribe","loadingChannels","loadingNextPage","loadNextPage","refreshing","exports"],"sources":["usePaginatedChannels.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { Channel, ChannelFilters, ChannelOptions, ChannelSort } from 'stream-chat';\n\nimport { useActiveChannelsRefContext } from '../../../contexts/activeChannelsRefContext/ActiveChannelsRefContext';\nimport { useChatContext } from '../../../contexts/chatContext/ChatContext';\nimport { useIsMountedRef } from '../../../hooks/useIsMountedRef';\n\nimport { getChannelsForFilterSort } from '../../../store/apis/getChannelsForFilterSort';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\nimport { ONE_SECOND_IN_MS } from '../../../utils/date';\nimport { DBSyncManager } from '../../../utils/DBSyncManager';\nimport { MAX_QUERY_CHANNELS_LIMIT } from '../utils';\n\nconst waitSeconds = (seconds: number) =>\n new Promise((resolve) => {\n setTimeout(resolve, seconds * ONE_SECOND_IN_MS);\n });\n\ntype Parameters<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> =\n {\n enableOfflineSupport: boolean;\n filters: ChannelFilters<StreamChatGenerics>;\n options: ChannelOptions;\n setForceUpdate: React.Dispatch<React.SetStateAction<number>>;\n sort: ChannelSort<StreamChatGenerics>;\n };\n\nconst DEFAULT_OPTIONS = {\n message_limit: 10,\n};\n\nconst MAX_NUMBER_OF_RETRIES = 3;\nconst RETRY_INTERVAL_IN_MS = 5000;\n\ntype QueryType = 'queryLocalDB' | 'reload' | 'refresh' | 'loadChannels';\n\nexport type QueryChannels = (queryType?: QueryType, retryCount?: number) => Promise<void>;\n\nexport const usePaginatedChannels = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n enableOfflineSupport,\n filters = {},\n options = DEFAULT_OPTIONS,\n setForceUpdate,\n sort = {},\n}: Parameters<StreamChatGenerics>) => {\n const [channels, setChannels] = useState<Channel<StreamChatGenerics>[] | null>(null);\n const [error, setError] = useState<Error | undefined>(undefined);\n const [staticChannelsActive, setStaticChannelsActive] = useState<boolean>(false);\n const [activeQueryType, setActiveQueryType] = useState<QueryType | null>('queryLocalDB');\n const [hasNextPage, setHasNextPage] = useState<boolean>(false);\n const activeChannels = useActiveChannelsRefContext();\n const isMountedRef = useIsMountedRef();\n const { client } = useChatContext<StreamChatGenerics>();\n\n const filtersRef = useRef<typeof filters | null>(null);\n const sortRef = useRef<typeof sort | null>(null);\n const activeRequestId = useRef<number>(0);\n const isQueryingRef = useRef(false);\n const lastRefresh = useRef(Date.now());\n\n const queryChannels: QueryChannels = async (\n queryType: QueryType = 'loadChannels',\n retryCount = 0,\n ): Promise<void> => {\n if (!client || !isMountedRef.current) return;\n\n const hasUpdatedData =\n queryType === 'loadChannels' ||\n queryType === 'refresh' ||\n [\n JSON.stringify(filtersRef.current) !== JSON.stringify(filters),\n JSON.stringify(sortRef.current) !== JSON.stringify(sort),\n ].some(Boolean);\n\n const isQueryStale = () => !isMountedRef || activeRequestId.current !== currentRequestId;\n\n /**\n * We don't need to make another call to query channels if we don't\n * have new data for the query to include\n * */\n if (!hasUpdatedData) {\n if (activeQueryType === null) return;\n }\n\n filtersRef.current = filters;\n sortRef.current = sort;\n isQueryingRef.current = true;\n setError(undefined);\n activeRequestId.current++;\n const currentRequestId = activeRequestId.current;\n setActiveQueryType(queryType);\n\n const newOptions = {\n limit: options?.limit ?? MAX_QUERY_CHANNELS_LIMIT,\n offset:\n queryType === 'loadChannels' && !staticChannelsActive && channels ? channels.length : 0,\n ...options,\n };\n\n try {\n /**\n * We skipInitialization here for handling race condition between ChannelList, Channel (and Thread)\n * when they all (may) update the channel state at the same time (when connection state recovers)\n * TODO: if we move the channel state to a single context and share it between ChannelList, Channel and Thread we can remove this\n */\n const channelQueryResponse = await client.queryChannels(filters, sort, newOptions, {\n skipInitialization: enableOfflineSupport ? undefined : activeChannels.current,\n });\n if (isQueryStale() || !isMountedRef.current) {\n return;\n }\n\n const newChannels =\n queryType === 'loadChannels' && !staticChannelsActive && channels\n ? [...channels, ...channelQueryResponse]\n : channelQueryResponse.map((c) => {\n const existingChannel = client.activeChannels[c.cid];\n if (existingChannel) {\n return existingChannel;\n }\n\n return c;\n });\n\n setChannels(newChannels);\n setStaticChannelsActive(false);\n setHasNextPage(channelQueryResponse.length >= newOptions.limit);\n isQueryingRef.current = false;\n } catch (err: unknown) {\n isQueryingRef.current = false;\n await waitSeconds(2);\n\n if (isQueryStale()) {\n return;\n }\n\n // querying.current check is needed in order to make sure the next query call doesnt flick an error\n // state and then succeed (reconnect case)\n if (retryCount === MAX_NUMBER_OF_RETRIES && !isQueryingRef.current) {\n setActiveQueryType(null);\n console.warn(err);\n\n setError(\n new Error(\n `Maximum number of retries reached in queryChannels. Last error message is: ${err}`,\n ),\n );\n return;\n }\n\n return queryChannels(queryType, retryCount + 1);\n }\n\n setActiveQueryType(null);\n };\n\n const refreshList = async () => {\n const now = Date.now();\n // Only allow pull-to-refresh 5 seconds after last successful refresh.\n if (now - lastRefresh.current < RETRY_INTERVAL_IN_MS && error === undefined) {\n return;\n }\n\n lastRefresh.current = Date.now();\n await queryChannels('refresh');\n };\n\n const reloadList = () => queryChannels('reload');\n\n /**\n * Equality check using stringified filters/sort ensure that we don't make un-necessary queryChannels api calls\n * for the scenario:\n *\n * <ChannelList\n * filters={{\n * members: { $in: ['vishal'] }\n * }}\n * ...\n * />\n *\n * Here we have passed filters as inline object, which means on every re-render of\n * parent component, ChannelList will receive new object reference (even though value is same), which\n * in return will trigger useEffect. To avoid this, we can add a value check.\n */\n const filterStr = useMemo(() => JSON.stringify(filters), [filters]);\n const sortStr = useMemo(() => JSON.stringify(sort), [sort]);\n\n useEffect(() => {\n const loadOfflineChannels = () => {\n if (!client?.user?.id) return;\n\n try {\n const channelsFromDB = getChannelsForFilterSort({\n currentUserId: client.user.id,\n filters,\n sort,\n });\n\n if (channelsFromDB) {\n const offlineChannels = client.hydrateActiveChannels(channelsFromDB, {\n offlineMode: true,\n skipInitialization: [], // passing empty array will clear out the existing messages from channel state, this removes the possibility of duplicate messages\n });\n\n setChannels(offlineChannels);\n setStaticChannelsActive(true);\n }\n } catch (e) {\n console.warn('Failed to get channels from database: ', e);\n }\n\n setActiveQueryType(null);\n };\n\n let listener: ReturnType<typeof DBSyncManager.onSyncStatusChange>;\n if (enableOfflineSupport) {\n // Any time DB is synced, we need to update the UI with local DB channels first,\n // and then call queryChannels to ensure any new channels are added to UI.\n listener = DBSyncManager.onSyncStatusChange((syncStatus) => {\n if (syncStatus) {\n loadOfflineChannels();\n reloadList();\n }\n });\n // On start, load the channels from local db.\n loadOfflineChannels();\n\n // If db is already synced (sync api and pending api calls), then\n // right away call queryChannels.\n const dbSyncStatus = DBSyncManager.getSyncStatus();\n if (dbSyncStatus) {\n reloadList();\n }\n } else {\n listener = client.on('connection.changed', async (event) => {\n if (event.online) {\n await refreshList();\n setForceUpdate((u) => u + 1);\n }\n });\n\n reloadList();\n }\n\n return () => listener?.unsubscribe?.();\n }, [filterStr, sortStr]);\n\n return {\n channels,\n error,\n hasNextPage,\n loadingChannels:\n activeQueryType === 'queryLocalDB'\n ? true\n : (activeQueryType === 'reload' || activeQueryType === null) && channels === null,\n loadingNextPage: activeQueryType === 'loadChannels',\n loadNextPage: queryChannels,\n refreshing: activeQueryType === 'refresh',\n refreshList,\n reloadList,\n // Although channels can be null, there is no practical case where channels will be null\n // when setChannels is used. setChannels is only recommended to be used for overriding\n // event handler. Thus instead of adding if check for channels === null, its better to\n // simply reassign types here.\n setChannels,\n staticChannelsActive,\n };\n};\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,IAAAI,yBAAA,GAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAEA,IAAMQ,WAAW,GAAG,SAAdA,WAAWA,CAAIC,OAAe;EAAA,OAClC,IAAIC,OAAO,CAAC,UAACC,OAAO,EAAK;IACvBC,UAAU,CAACD,OAAO,EAAEF,OAAO,GAAGI,sBAAgB,CAAC;EACjD,CAAC,CAAC;AAAA;AAWJ,IAAMC,eAAe,GAAG;EACtBC,aAAa,EAAE;AACjB,CAAC;AAED,IAAMC,qBAAqB,GAAG,CAAC;AAC/B,IAAMC,oBAAoB,GAAG,IAAI;AAM1B,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAQK;EAAA,IALpCC,oBAAoB,GAAAD,IAAA,CAApBC,oBAAoB;IAAAC,YAAA,GAAAF,IAAA,CACpBG,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,CAAC,CAAC,GAAAA,YAAA;IAAAE,YAAA,GAAAJ,IAAA,CACZK,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAGT,eAAe,GAAAS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AAI,KAAKb,QAAQ,KAAK,IAAI;IACrFwH,eAAe,EAAE3G,eAAe,KAAK,cAAc;IACnD4G,YAAY,EAAEvF,aAAa;IAC3BwF,UAAU,EAAE7G,eAAe,KAAK,SAAS;IACzCoE,WAAW,EAAXA,WAAW;IACXK,UAAU,EAAVA,UAAU;IAKVrF,WAAW,EAAXA,WAAW;IACXQ,oBAAoB,EAApBA;EACF,CAAC;AACH,CAAC;AAACkH,OAAA,CAAAzI,oBAAA,GAAAA,oBAAA"}
|
|
1
|
+
{"version":3,"names":["_react","require","_ActiveChannelsRefContext","_ChatContext","_useIsMountedRef","_getChannelsForFilterSort","_date","_DBSyncManager","_utils","waitSeconds","seconds","Promise","resolve","setTimeout","ONE_SECOND_IN_MS","DEFAULT_OPTIONS","message_limit","MAX_NUMBER_OF_RETRIES","RETRY_INTERVAL_IN_MS","usePaginatedChannels","_ref","enableOfflineSupport","_ref$filters","filters","_ref$options","options","setForceUpdate","_ref$sort","sort","_useState","useState","_useState2","_slicedToArray2","channels","setChannels","_useState3","undefined","_useState4","error","setError","_useState5","_useState6","staticChannelsActive","setStaticChannelsActive","_useState7","_useState8","activeQueryType","setActiveQueryType","_useState9","_useState10","hasNextPage","setHasNextPage","activeChannels","useActiveChannelsRefContext","isMountedRef","useIsMountedRef","_useChatContext","useChatContext","client","filtersRef","useRef","sortRef","activeRequestId","isQueryingRef","lastRefresh","Date","now","queryChannels","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_options$limit","queryType","retryCount","hasUpdatedData","isQueryStale","currentRequestId","newOptions","channelQueryResponse","newChannels","_args","arguments","wrap","_callee$","_context","prev","next","length","current","abrupt","JSON","stringify","some","Boolean","_extends2","limit","MAX_QUERY_CHANNELS_LIMIT","offset","skipInitialization","sent","concat","_toConsumableArray2","map","c","existingChannel","cid","t0","console","warn","Error","stop","apply","refreshList","_ref3","_callee2","_callee2$","_context2","reloadList","_ref4","_callee3","_callee3$","_context3","filterStr","useMemo","sortStr","useEffect","loadOfflineChannels","_client$user","user","id","channelsFromDB","getChannelsForFilterSort","currentUserId","offlineChannels","hydrateActiveChannels","offlineMode","e","listener","DBSyncManager","onSyncStatusChange","_ref5","_callee4","syncStatus","_callee4$","_context4","u","_x","dbSyncStatus","getSyncStatus","on","_ref6","_callee5","event","_callee5$","_context5","online","_x2","_listener","unsubscribe","loadingChannels","loadingNextPage","loadNextPage","refreshing","exports"],"sources":["usePaginatedChannels.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { Channel, ChannelFilters, ChannelOptions, ChannelSort } from 'stream-chat';\n\nimport { useActiveChannelsRefContext } from '../../../contexts/activeChannelsRefContext/ActiveChannelsRefContext';\nimport { useChatContext } from '../../../contexts/chatContext/ChatContext';\nimport { useIsMountedRef } from '../../../hooks/useIsMountedRef';\n\nimport { getChannelsForFilterSort } from '../../../store/apis/getChannelsForFilterSort';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\nimport { ONE_SECOND_IN_MS } from '../../../utils/date';\nimport { DBSyncManager } from '../../../utils/DBSyncManager';\nimport { MAX_QUERY_CHANNELS_LIMIT } from '../utils';\n\nconst waitSeconds = (seconds: number) =>\n new Promise((resolve) => {\n setTimeout(resolve, seconds * ONE_SECOND_IN_MS);\n });\n\ntype Parameters<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> =\n {\n enableOfflineSupport: boolean;\n filters: ChannelFilters<StreamChatGenerics>;\n options: ChannelOptions;\n setForceUpdate: React.Dispatch<React.SetStateAction<number>>;\n sort: ChannelSort<StreamChatGenerics>;\n };\n\nconst DEFAULT_OPTIONS = {\n message_limit: 10,\n};\n\nconst MAX_NUMBER_OF_RETRIES = 3;\nconst RETRY_INTERVAL_IN_MS = 5000;\n\ntype QueryType = 'queryLocalDB' | 'reload' | 'refresh' | 'loadChannels';\n\nexport type QueryChannels = (queryType?: QueryType, retryCount?: number) => Promise<void>;\n\nexport const usePaginatedChannels = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n enableOfflineSupport,\n filters = {},\n options = DEFAULT_OPTIONS,\n setForceUpdate,\n sort = {},\n}: Parameters<StreamChatGenerics>) => {\n const [channels, setChannels] = useState<Channel<StreamChatGenerics>[] | null>(null);\n const [error, setError] = useState<Error | undefined>(undefined);\n const [staticChannelsActive, setStaticChannelsActive] = useState<boolean>(false);\n const [activeQueryType, setActiveQueryType] = useState<QueryType | null>('queryLocalDB');\n const [hasNextPage, setHasNextPage] = useState<boolean>(false);\n const activeChannels = useActiveChannelsRefContext();\n const isMountedRef = useIsMountedRef();\n const { client } = useChatContext<StreamChatGenerics>();\n\n const filtersRef = useRef<typeof filters | null>(null);\n const sortRef = useRef<typeof sort | null>(null);\n const activeRequestId = useRef<number>(0);\n const isQueryingRef = useRef(false);\n const lastRefresh = useRef(Date.now());\n\n const queryChannels: QueryChannels = async (\n queryType: QueryType = 'loadChannels',\n retryCount = 0,\n ): Promise<void> => {\n if (!client || !isMountedRef.current) return;\n\n const hasUpdatedData =\n queryType === 'loadChannels' ||\n queryType === 'refresh' ||\n [\n JSON.stringify(filtersRef.current) !== JSON.stringify(filters),\n JSON.stringify(sortRef.current) !== JSON.stringify(sort),\n ].some(Boolean);\n\n const isQueryStale = () => !isMountedRef || activeRequestId.current !== currentRequestId;\n\n /**\n * We don't need to make another call to query channels if we don't\n * have new data for the query to include\n * */\n if (!hasUpdatedData) {\n if (activeQueryType === null) return;\n }\n\n filtersRef.current = filters;\n sortRef.current = sort;\n isQueryingRef.current = true;\n setError(undefined);\n activeRequestId.current++;\n const currentRequestId = activeRequestId.current;\n setActiveQueryType(queryType);\n\n const newOptions = {\n limit: options?.limit ?? MAX_QUERY_CHANNELS_LIMIT,\n offset:\n queryType === 'loadChannels' && !staticChannelsActive && channels ? channels.length : 0,\n ...options,\n };\n\n try {\n /**\n * We skipInitialization here for handling race condition between ChannelList, Channel (and Thread)\n * when they all (may) update the channel state at the same time (when connection state recovers)\n * TODO: if we move the channel state to a single context and share it between ChannelList, Channel and Thread we can remove this\n */\n const channelQueryResponse = await client.queryChannels(filters, sort, newOptions, {\n skipInitialization: enableOfflineSupport ? undefined : activeChannels.current,\n });\n if (isQueryStale() || !isMountedRef.current) {\n return;\n }\n\n const newChannels =\n queryType === 'loadChannels' && !staticChannelsActive && channels\n ? [...channels, ...channelQueryResponse]\n : channelQueryResponse.map((c) => {\n const existingChannel = client.activeChannels[c.cid];\n if (existingChannel) {\n return existingChannel;\n }\n\n return c;\n });\n\n setChannels(newChannels);\n setStaticChannelsActive(false);\n setHasNextPage(channelQueryResponse.length >= newOptions.limit);\n isQueryingRef.current = false;\n } catch (err: unknown) {\n isQueryingRef.current = false;\n await waitSeconds(2);\n\n if (isQueryStale()) {\n return;\n }\n\n // querying.current check is needed in order to make sure the next query call doesnt flick an error\n // state and then succeed (reconnect case)\n if (retryCount === MAX_NUMBER_OF_RETRIES && !isQueryingRef.current) {\n setActiveQueryType(null);\n console.warn(err);\n\n setError(\n new Error(\n `Maximum number of retries reached in queryChannels. Last error message is: ${err}`,\n ),\n );\n return;\n }\n\n return queryChannels(queryType, retryCount + 1);\n }\n\n setActiveQueryType(null);\n };\n\n const refreshList = async () => {\n const now = Date.now();\n // Only allow pull-to-refresh 5 seconds after last successful refresh.\n if (now - lastRefresh.current < RETRY_INTERVAL_IN_MS && error === undefined) {\n return;\n }\n\n lastRefresh.current = Date.now();\n await queryChannels('refresh');\n };\n\n const reloadList = async () => {\n await queryChannels('reload');\n };\n\n /**\n * Equality check using stringified filters/sort ensure that we don't make un-necessary queryChannels api calls\n * for the scenario:\n *\n * <ChannelList\n * filters={{\n * members: { $in: ['vishal'] }\n * }}\n * ...\n * />\n *\n * Here we have passed filters as inline object, which means on every re-render of\n * parent component, ChannelList will receive new object reference (even though value is same), which\n * in return will trigger useEffect. To avoid this, we can add a value check.\n */\n const filterStr = useMemo(() => JSON.stringify(filters), [filters]);\n const sortStr = useMemo(() => JSON.stringify(sort), [sort]);\n\n useEffect(() => {\n const loadOfflineChannels = () => {\n if (!client?.user?.id) return;\n\n try {\n const channelsFromDB = getChannelsForFilterSort({\n currentUserId: client.user.id,\n filters,\n sort,\n });\n\n if (channelsFromDB) {\n const offlineChannels = client.hydrateActiveChannels(channelsFromDB, {\n offlineMode: true,\n skipInitialization: [], // passing empty array will clear out the existing messages from channel state, this removes the possibility of duplicate messages\n });\n\n setChannels(offlineChannels);\n setStaticChannelsActive(true);\n }\n } catch (e) {\n console.warn('Failed to get channels from database: ', e);\n }\n\n setActiveQueryType(null);\n };\n\n let listener: ReturnType<typeof DBSyncManager.onSyncStatusChange>;\n if (enableOfflineSupport) {\n // Any time DB is synced, we need to update the UI with local DB channels first,\n // and then call queryChannels to ensure any new channels are added to UI.\n listener = DBSyncManager.onSyncStatusChange(async (syncStatus) => {\n if (syncStatus) {\n loadOfflineChannels();\n await reloadList();\n setForceUpdate((u) => u + 1);\n }\n });\n // On start, load the channels from local db.\n loadOfflineChannels();\n\n // If db is already synced (sync api and pending api calls), then\n // right away call queryChannels.\n const dbSyncStatus = DBSyncManager.getSyncStatus();\n if (dbSyncStatus) {\n reloadList();\n }\n } else {\n listener = client.on('connection.changed', async (event) => {\n if (event.online) {\n await refreshList();\n setForceUpdate((u) => u + 1);\n }\n });\n\n reloadList();\n }\n\n return () => listener?.unsubscribe?.();\n }, [filterStr, sortStr]);\n\n return {\n channels,\n error,\n hasNextPage,\n loadingChannels:\n activeQueryType === 'queryLocalDB'\n ? true\n : (activeQueryType === 'reload' || activeQueryType === null) && channels === null,\n loadingNextPage: activeQueryType === 'loadChannels',\n loadNextPage: queryChannels,\n refreshing: activeQueryType === 'refresh',\n refreshList,\n reloadList,\n // Although channels can be null, there is no practical case where channels will be null\n // when setChannels is used. setChannels is only recommended to be used for overriding\n // event handler. Thus instead of adding if check for channels === null, its better to\n // simply reassign types here.\n setChannels,\n staticChannelsActive,\n };\n};\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,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A,OAAAN,KAAA,CAAAvC,KAAA,OAAA9B,SAAA;QAAA;MAAA,IAAC;MAEFoC,UAAU,CAAC,CAAC;IACd;IAEA,OAAO;MAAA,IAAAwC,SAAA;MAAA,QAAAA,SAAA,GAAMpB,QAAQ,qBAARoB,SAAA,CAAUC,WAAW,oBAArBD,SAAA,CAAUC,WAAW,CAAG,CAAC;IAAA;EACxC,CAAC,EAAE,CAACpC,SAAS,EAAEE,OAAO,CAAC,CAAC;EAExB,OAAO;IACL7F,QAAQ,EAARA,QAAQ;IACRK,KAAK,EAALA,KAAK;IACLY,WAAW,EAAXA,WAAW;IACX+G,eAAe,EACbnH,eAAe,KAAK,cAAc,GAC9B,IAAI,GACJ,CAACA,eAAe,KAAK,QAAQ,IAAIA,eAAe,KAAK,IAAI,KAAKb,QAAQ,KAAK,IAAI;IACrFiI,eAAe,EAAEpH,eAAe,KAAK,cAAc;IACnDqH,YAAY,EAAEhG,aAAa;IAC3BiG,UAAU,EAAEtH,eAAe,KAAK,SAAS;IACzCoE,WAAW,EAAXA,WAAW;IACXK,UAAU,EAAVA,UAAU;IAKVrF,WAAW,EAAXA,WAAW;IACXQ,oBAAoB,EAApBA;EACF,CAAC;AACH,CAAC;AAAC2H,OAAA,CAAAlJ,oBAAA,GAAAA,oBAAA"}
|
|
@@ -18,6 +18,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
18
18
|
var ChannelPreviewWithContext = function ChannelPreviewWithContext(props) {
|
|
19
19
|
var channel = props.channel,
|
|
20
20
|
client = props.client,
|
|
21
|
+
channelListForceUpdate = props.forceUpdate,
|
|
21
22
|
Preview = props.Preview;
|
|
22
23
|
var _useState = (0, _react.useState)(channel.state.messages[channel.state.messages.length - 1]),
|
|
23
24
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -48,7 +49,7 @@ var ChannelPreviewWithContext = function ChannelPreviewWithContext(props) {
|
|
|
48
49
|
}
|
|
49
50
|
var newUnreadCount = channel.countUnread();
|
|
50
51
|
setUnread(newUnreadCount);
|
|
51
|
-
}, [channelLastMessageString]);
|
|
52
|
+
}, [channelLastMessageString, channelListForceUpdate]);
|
|
52
53
|
(0, _react.useEffect)(function () {
|
|
53
54
|
var handleNewMessageEvent = function handleNewMessageEvent(event) {
|
|
54
55
|
var message = event.message;
|
|
@@ -105,9 +106,11 @@ var ChannelPreview = function ChannelPreview(props) {
|
|
|
105
106
|
var _useChatContext = (0, _ChatContext.useChatContext)(),
|
|
106
107
|
client = _useChatContext.client;
|
|
107
108
|
var _useChannelsContext = (0, _ChannelsContext.useChannelsContext)(),
|
|
109
|
+
forceUpdate = _useChannelsContext.forceUpdate,
|
|
108
110
|
Preview = _useChannelsContext.Preview;
|
|
109
111
|
return _react["default"].createElement(ChannelPreviewWithContext, (0, _extends2["default"])({
|
|
110
112
|
client: client,
|
|
113
|
+
forceUpdate: forceUpdate,
|
|
111
114
|
Preview: Preview
|
|
112
115
|
}, props, {
|
|
113
116
|
__self: _this,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_useLatestMessagePreview","_ChannelsContext","_ChatContext","_useTranslatedMessage","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChannelPreviewWithContext","props","channel","client","Preview","_useState","useState","state","messages","length","_useState2","_slicedToArray2","lastMessage","setLastMessage","translatedLastMessage","useTranslatedMessage","_useState3","_useState4","forceUpdate","setForceUpdate","_useState5","countUnread","_useState6","unread","setUnread","latestMessagePreview","useLatestMessagePreview","channelLastMessage","channelLastMessageString","id","updated_at","useEffect","_client$on","on","unsubscribe","newUnreadCount","handleNewMessageEvent","event","message","parent_id","show_in_channel","handleUpdatedOrDeletedMessage","prevLastMessage","_event$message","listeners","forEach","l","handleReadEvent","_event$user","_event$user2","user","userID","prev","listener","createElement","__self","__source","fileName","lineNumber","columnNumber","ChannelPreview","_useChatContext","useChatContext","_useChannelsContext","useChannelsContext","_extends2","exports"],"sources":["ChannelPreview.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport type { Channel, ChannelState, Event, MessageResponse } from 'stream-chat';\n\nimport { useLatestMessagePreview } from './hooks/useLatestMessagePreview';\n\nimport {\n ChannelsContextValue,\n useChannelsContext,\n} from '../../contexts/channelsContext/ChannelsContext';\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\n\nimport { useTranslatedMessage } from '../../hooks/useTranslatedMessage';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nexport type ChannelPreviewPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Pick<ChannelsContextValue<StreamChatGenerics>, 'Preview'> & {\n /**\n * The previewed channel\n */\n channel: Channel<StreamChatGenerics>;\n };\n\n/**\n * This component manages state for the ChannelPreviewMessenger UI component and receives\n * all props from the ChannelListMessenger component.\n */\nconst ChannelPreviewWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewPropsWithContext<StreamChatGenerics>,\n) => {\n const { channel, client, Preview } = props;\n\n const [lastMessage, setLastMessage] = useState<\n | ReturnType<ChannelState<StreamChatGenerics>['formatMessage']>\n | MessageResponse<StreamChatGenerics>\n | undefined\n >(channel.state.messages[channel.state.messages.length - 1]);\n\n const translatedLastMessage = useTranslatedMessage<StreamChatGenerics>(\n lastMessage || ({} as MessageResponse<StreamChatGenerics>),\n );\n\n const [forceUpdate, setForceUpdate] = useState(0);\n const [unread, setUnread] = useState(channel.countUnread());\n\n const latestMessagePreview = useLatestMessagePreview(channel, forceUpdate, translatedLastMessage);\n\n const channelLastMessage = channel.lastMessage();\n const channelLastMessageString = `${channelLastMessage?.id}${channelLastMessage?.updated_at}`;\n\n useEffect(() => {\n const { unsubscribe } = client.on('notification.mark_read', () => {\n setUnread(channel.countUnread());\n });\n return unsubscribe;\n }, []);\n\n useEffect(() => {\n if (\n channelLastMessage &&\n (channelLastMessage.id !== lastMessage?.id ||\n channelLastMessage.updated_at !== lastMessage?.updated_at)\n ) {\n setLastMessage(channelLastMessage);\n }\n\n const newUnreadCount = channel.countUnread();\n setUnread(newUnreadCount);\n }, [channelLastMessageString]);\n\n useEffect(() => {\n const handleNewMessageEvent = (event: Event<StreamChatGenerics>) => {\n const message = event.message;\n if (message && (!message.parent_id || message.show_in_channel)) {\n setLastMessage(event.message);\n setUnread(channel.countUnread());\n }\n };\n\n const handleUpdatedOrDeletedMessage = (event: Event<StreamChatGenerics>) => {\n setLastMessage((prevLastMessage) => {\n if (prevLastMessage?.id === event.message?.id) {\n return event.message;\n }\n return prevLastMessage;\n });\n };\n\n const listeners = [\n channel.on('message.new', handleNewMessageEvent),\n channel.on('message.updated', handleUpdatedOrDeletedMessage),\n channel.on('message.deleted', handleUpdatedOrDeletedMessage),\n ];\n\n return () => listeners.forEach((l) => l.unsubscribe());\n }, []);\n\n useEffect(() => {\n const handleReadEvent = (event: Event<StreamChatGenerics>) => {\n if (event.user?.id === client.userID) {\n setUnread(0);\n } else if (event.user?.id) {\n setForceUpdate((prev) => prev + 1);\n }\n };\n\n const listener = channel.on('message.read', handleReadEvent);\n return () => listener.unsubscribe();\n }, []);\n\n return <Preview channel={channel} latestMessagePreview={latestMessagePreview} unread={unread} />;\n};\n\nexport type ChannelPreviewProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<Omit<ChannelPreviewPropsWithContext<StreamChatGenerics>, 'channel'>> &\n Pick<ChannelPreviewPropsWithContext<StreamChatGenerics>, 'channel'>;\n\nexport const ChannelPreview = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewProps<StreamChatGenerics>,\n) => {\n const { client } = useChatContext<StreamChatGenerics>();\n const { Preview } = useChannelsContext<StreamChatGenerics>();\n\n return <ChannelPreviewWithContext {...{ client, Preview }} {...props} />;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,wBAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAF,OAAA;AAIA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,qBAAA,GAAAJ,OAAA;AAAwE,IAAAK,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CA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AAE,EAAE,CAAC;EAEN,OAAOjE,MAAA,YAAAqF,aAAA,CAAClD,OAAO;IAACF,OAAO,EAAEA,OAAQ;IAACuB,oBAAoB,EAAEA,oBAAqB;IAACF,MAAM,EAAEA,MAAO;IAAAgC,MAAA,EAAA/E,KAAA;IAAAgF,QAAA;MAAAC,QAAA,EAAAhF,YAAA;MAAAiF,UAAA;MAAAC,YAAA;IAAA;EAAA,CAAE,CAAC;AAClG,CAAC;AAOM,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAGzB3D,KAA8C,EAC3C;EACH,IAAA4D,eAAA,GAAmB,IAAAC,2BAAc,EAAqB,CAAC;IAA/C3D,MAAM,GAAA0D,eAAA,CAAN1D,MAAM;EACd,IAAA4D,mBAAA,GAAoB,IAAAC,mCAAkB,EAAqB,CAAC;IAApD5D,OAAO,GAAA2D,mBAAA,CAAP3D,OAAO;EAEf,OAAOnC,MAAA,YAAAqF,aAAA,CAACtD,yBAAyB,MAAAiE,SAAA;IAAO9D,MAAM,EAANA,MAAM;IAAEC,OAAO,EAAPA;EAAO,GAAQH,KAAK;IAAAsD,MAAA,EAAA/E,KAAA;IAAAgF,QAAA;MAAAC,QAAA,EAAAhF,YAAA;MAAAiF,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAG,CAAC;AAC1E,CAAC;AAACO,OAAA,CAAAN,cAAA,GAAAA,cAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_useLatestMessagePreview","_ChannelsContext","_ChatContext","_useTranslatedMessage","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChannelPreviewWithContext","props","channel","client","channelListForceUpdate","forceUpdate","Preview","_useState","useState","state","messages","length","_useState2","_slicedToArray2","lastMessage","setLastMessage","translatedLastMessage","useTranslatedMessage","_useState3","_useState4","setForceUpdate","_useState5","countUnread","_useState6","unread","setUnread","latestMessagePreview","useLatestMessagePreview","channelLastMessage","channelLastMessageString","id","updated_at","useEffect","_client$on","on","unsubscribe","newUnreadCount","handleNewMessageEvent","event","message","parent_id","show_in_channel","handleUpdatedOrDeletedMessage","prevLastMessage","_event$message","listeners","forEach","l","handleReadEvent","_event$user","_event$user2","user","userID","prev","listener","createElement","__self","__source","fileName","lineNumber","columnNumber","ChannelPreview","_useChatContext","useChatContext","_useChannelsContext","useChannelsContext","_extends2","exports"],"sources":["ChannelPreview.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport type { Channel, ChannelState, Event, MessageResponse } from 'stream-chat';\n\nimport { useLatestMessagePreview } from './hooks/useLatestMessagePreview';\n\nimport {\n ChannelsContextValue,\n useChannelsContext,\n} from '../../contexts/channelsContext/ChannelsContext';\nimport { ChatContextValue, useChatContext } from '../../contexts/chatContext/ChatContext';\n\nimport { useTranslatedMessage } from '../../hooks/useTranslatedMessage';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\n\nexport type ChannelPreviewPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Pick<ChannelsContextValue<StreamChatGenerics>, 'Preview' | 'forceUpdate'> & {\n /**\n * The previewed channel\n */\n channel: Channel<StreamChatGenerics>;\n };\n\n/**\n * This component manages state for the ChannelPreviewMessenger UI component and receives\n * all props from the ChannelListMessenger component.\n */\nconst ChannelPreviewWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewPropsWithContext<StreamChatGenerics>,\n) => {\n const { channel, client, forceUpdate: channelListForceUpdate, Preview } = props;\n\n const [lastMessage, setLastMessage] = useState<\n | ReturnType<ChannelState<StreamChatGenerics>['formatMessage']>\n | MessageResponse<StreamChatGenerics>\n | undefined\n >(channel.state.messages[channel.state.messages.length - 1]);\n\n const translatedLastMessage = useTranslatedMessage<StreamChatGenerics>(\n lastMessage || ({} as MessageResponse<StreamChatGenerics>),\n );\n\n const [forceUpdate, setForceUpdate] = useState(0);\n const [unread, setUnread] = useState(channel.countUnread());\n\n const latestMessagePreview = useLatestMessagePreview(channel, forceUpdate, translatedLastMessage);\n\n const channelLastMessage = channel.lastMessage();\n const channelLastMessageString = `${channelLastMessage?.id}${channelLastMessage?.updated_at}`;\n\n useEffect(() => {\n const { unsubscribe } = client.on('notification.mark_read', () => {\n setUnread(channel.countUnread());\n });\n return unsubscribe;\n }, []);\n\n useEffect(() => {\n if (\n channelLastMessage &&\n (channelLastMessage.id !== lastMessage?.id ||\n channelLastMessage.updated_at !== lastMessage?.updated_at)\n ) {\n setLastMessage(channelLastMessage);\n }\n\n const newUnreadCount = channel.countUnread();\n setUnread(newUnreadCount);\n }, [channelLastMessageString, channelListForceUpdate]);\n\n useEffect(() => {\n const handleNewMessageEvent = (event: Event<StreamChatGenerics>) => {\n const message = event.message;\n if (message && (!message.parent_id || message.show_in_channel)) {\n setLastMessage(event.message);\n setUnread(channel.countUnread());\n }\n };\n\n const handleUpdatedOrDeletedMessage = (event: Event<StreamChatGenerics>) => {\n setLastMessage((prevLastMessage) => {\n if (prevLastMessage?.id === event.message?.id) {\n return event.message;\n }\n return prevLastMessage;\n });\n };\n\n const listeners = [\n channel.on('message.new', handleNewMessageEvent),\n channel.on('message.updated', handleUpdatedOrDeletedMessage),\n channel.on('message.deleted', handleUpdatedOrDeletedMessage),\n ];\n\n return () => listeners.forEach((l) => l.unsubscribe());\n }, []);\n\n useEffect(() => {\n const handleReadEvent = (event: Event<StreamChatGenerics>) => {\n if (event.user?.id === client.userID) {\n setUnread(0);\n } else if (event.user?.id) {\n setForceUpdate((prev) => prev + 1);\n }\n };\n\n const listener = channel.on('message.read', handleReadEvent);\n return () => listener.unsubscribe();\n }, []);\n\n return <Preview channel={channel} latestMessagePreview={latestMessagePreview} unread={unread} />;\n};\n\nexport type ChannelPreviewProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<Omit<ChannelPreviewPropsWithContext<StreamChatGenerics>, 'channel'>> &\n Pick<ChannelPreviewPropsWithContext<StreamChatGenerics>, 'channel'>;\n\nexport const ChannelPreview = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewProps<StreamChatGenerics>,\n) => {\n const { client } = useChatContext<StreamChatGenerics>();\n const { forceUpdate, Preview } = useChannelsContext<StreamChatGenerics>();\n\n return <ChannelPreviewWithContext {...{ client, forceUpdate, Preview }} {...props} />;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,wBAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAF,OAAA;AAIA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,qBAAA,GAAAJ,OAAA;AAAwE,IAAAK,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC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AAAN,cAAA,GAAAA,cAAA"}
|
|
@@ -264,7 +264,8 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
264
264
|
if (!client || !channel || rawMessageList.length === 0) {
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
|
-
|
|
267
|
+
var isMessageRemovedFromMessageList = messageListLengthAfterUpdate < messageListLengthBeforeUpdate.current;
|
|
268
|
+
if (isMessageRemovedFromMessageList || (_topMessageBeforeUpda = topMessageBeforeUpdate.current) != null && _topMessageBeforeUpda.created_at && topMessageAfterUpdate != null && topMessageAfterUpdate.created_at && topMessageBeforeUpdate.current.created_at < topMessageAfterUpdate.created_at) {
|
|
268
269
|
channelResyncScrollSet.current = false;
|
|
269
270
|
setScrollToBottomButtonVisible(false);
|
|
270
271
|
resetPaginationTrackersRef.current();
|
|
@@ -361,7 +362,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
361
362
|
__self: _this,
|
|
362
363
|
__source: {
|
|
363
364
|
fileName: _jsxFileName,
|
|
364
|
-
lineNumber:
|
|
365
|
+
lineNumber: 637,
|
|
365
366
|
columnNumber: 11
|
|
366
367
|
}
|
|
367
368
|
}, _react["default"].createElement(MessageSystem, {
|
|
@@ -372,14 +373,14 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
372
373
|
__self: _this,
|
|
373
374
|
__source: {
|
|
374
375
|
fileName: _jsxFileName,
|
|
375
|
-
lineNumber:
|
|
376
|
+
lineNumber: 638,
|
|
376
377
|
columnNumber: 13
|
|
377
378
|
}
|
|
378
379
|
})), insertInlineUnreadIndicator && _react["default"].createElement(InlineUnreadIndicator, {
|
|
379
380
|
__self: _this,
|
|
380
381
|
__source: {
|
|
381
382
|
fileName: _jsxFileName,
|
|
382
|
-
lineNumber:
|
|
383
|
+
lineNumber: 643,
|
|
383
384
|
columnNumber: 43
|
|
384
385
|
}
|
|
385
386
|
}));
|
|
@@ -390,7 +391,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
390
391
|
__self: _this,
|
|
391
392
|
__source: {
|
|
392
393
|
fileName: _jsxFileName,
|
|
393
|
-
lineNumber:
|
|
394
|
+
lineNumber: 650,
|
|
394
395
|
columnNumber: 32
|
|
395
396
|
}
|
|
396
397
|
});
|
|
@@ -409,7 +410,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
409
410
|
__self: _this,
|
|
410
411
|
__source: {
|
|
411
412
|
fileName: _jsxFileName,
|
|
412
|
-
lineNumber:
|
|
413
|
+
lineNumber: 652,
|
|
413
414
|
columnNumber: 7
|
|
414
415
|
}
|
|
415
416
|
});
|
|
@@ -418,7 +419,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
418
419
|
__self: _this,
|
|
419
420
|
__source: {
|
|
420
421
|
fileName: _jsxFileName,
|
|
421
|
-
lineNumber:
|
|
422
|
+
lineNumber: 669,
|
|
422
423
|
columnNumber: 9
|
|
423
424
|
}
|
|
424
425
|
}, _react["default"].createElement(_reactNative.View, {
|
|
@@ -426,14 +427,14 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
426
427
|
__self: _this,
|
|
427
428
|
__source: {
|
|
428
429
|
fileName: _jsxFileName,
|
|
429
|
-
lineNumber:
|
|
430
|
+
lineNumber: 670,
|
|
430
431
|
columnNumber: 11
|
|
431
432
|
}
|
|
432
433
|
}, renderMessage)), !shouldApplyAndroidWorkaround && renderDateSeperator, insertInlineUnreadIndicator && _react["default"].createElement(InlineUnreadIndicator, {
|
|
433
434
|
__self: _this,
|
|
434
435
|
__source: {
|
|
435
436
|
fileName: _jsxFileName,
|
|
436
|
-
lineNumber:
|
|
437
|
+
lineNumber: 674,
|
|
437
438
|
columnNumber: 41
|
|
438
439
|
}
|
|
439
440
|
})) : _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_reactNative.View, {
|
|
@@ -441,14 +442,14 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
441
442
|
__self: _this,
|
|
442
443
|
__source: {
|
|
443
444
|
fileName: _jsxFileName,
|
|
444
|
-
lineNumber:
|
|
445
|
+
lineNumber: 678,
|
|
445
446
|
columnNumber: 9
|
|
446
447
|
}
|
|
447
448
|
}, shouldApplyAndroidWorkaround && renderDateSeperator, renderMessage), !shouldApplyAndroidWorkaround && renderDateSeperator, insertInlineUnreadIndicator && _react["default"].createElement(InlineUnreadIndicator, {
|
|
448
449
|
__self: _this,
|
|
449
450
|
__source: {
|
|
450
451
|
fileName: _jsxFileName,
|
|
451
|
-
lineNumber:
|
|
452
|
+
lineNumber: 684,
|
|
452
453
|
columnNumber: 41
|
|
453
454
|
}
|
|
454
455
|
}));
|
|
@@ -760,7 +761,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
760
761
|
__self: _this,
|
|
761
762
|
__source: {
|
|
762
763
|
fileName: _jsxFileName,
|
|
763
|
-
lineNumber:
|
|
764
|
+
lineNumber: 1072,
|
|
764
765
|
columnNumber: 7
|
|
765
766
|
}
|
|
766
767
|
}, _react["default"].createElement(EmptyStateIndicator, {
|
|
@@ -768,7 +769,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
768
769
|
__self: _this,
|
|
769
770
|
__source: {
|
|
770
771
|
fileName: _jsxFileName,
|
|
771
|
-
lineNumber:
|
|
772
|
+
lineNumber: 1076,
|
|
772
773
|
columnNumber: 9
|
|
773
774
|
}
|
|
774
775
|
}));
|
|
@@ -779,14 +780,14 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
779
780
|
__self: _this,
|
|
780
781
|
__source: {
|
|
781
782
|
fileName: _jsxFileName,
|
|
782
|
-
lineNumber:
|
|
783
|
+
lineNumber: 1084,
|
|
783
784
|
columnNumber: 7
|
|
784
785
|
}
|
|
785
786
|
}, _react["default"].createElement(FooterComponent, {
|
|
786
787
|
__self: _this,
|
|
787
788
|
__source: {
|
|
788
789
|
fileName: _jsxFileName,
|
|
789
|
-
lineNumber:
|
|
790
|
+
lineNumber: 1085,
|
|
790
791
|
columnNumber: 9
|
|
791
792
|
}
|
|
792
793
|
}));
|
|
@@ -797,14 +798,14 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
797
798
|
__self: _this,
|
|
798
799
|
__source: {
|
|
799
800
|
fileName: _jsxFileName,
|
|
800
|
-
lineNumber:
|
|
801
|
+
lineNumber: 1093,
|
|
801
802
|
columnNumber: 7
|
|
802
803
|
}
|
|
803
804
|
}, _react["default"].createElement(HeaderComponent, {
|
|
804
805
|
__self: _this,
|
|
805
806
|
__source: {
|
|
806
807
|
fileName: _jsxFileName,
|
|
807
|
-
lineNumber:
|
|
808
|
+
lineNumber: 1094,
|
|
808
809
|
columnNumber: 9
|
|
809
810
|
}
|
|
810
811
|
}));
|
|
@@ -816,7 +817,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
816
817
|
__self: _this,
|
|
817
818
|
__source: {
|
|
818
819
|
fileName: _jsxFileName,
|
|
819
|
-
lineNumber:
|
|
820
|
+
lineNumber: 1104,
|
|
820
821
|
columnNumber: 7
|
|
821
822
|
}
|
|
822
823
|
}, _react["default"].createElement(LoadingIndicator, {
|
|
@@ -824,7 +825,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
824
825
|
__self: _this,
|
|
825
826
|
__source: {
|
|
826
827
|
fileName: _jsxFileName,
|
|
827
|
-
lineNumber:
|
|
828
|
+
lineNumber: 1105,
|
|
828
829
|
columnNumber: 9
|
|
829
830
|
}
|
|
830
831
|
}));
|
|
@@ -836,7 +837,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
836
837
|
__self: _this,
|
|
837
838
|
__source: {
|
|
838
839
|
fileName: _jsxFileName,
|
|
839
|
-
lineNumber:
|
|
840
|
+
lineNumber: 1112,
|
|
840
841
|
columnNumber: 30
|
|
841
842
|
}
|
|
842
843
|
});
|
|
@@ -845,7 +846,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
845
846
|
__self: _this,
|
|
846
847
|
__source: {
|
|
847
848
|
fileName: _jsxFileName,
|
|
848
|
-
lineNumber:
|
|
849
|
+
lineNumber: 1113,
|
|
849
850
|
columnNumber: 46
|
|
850
851
|
}
|
|
851
852
|
});
|
|
@@ -866,7 +867,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
866
867
|
__self: _this,
|
|
867
868
|
__source: {
|
|
868
869
|
fileName: _jsxFileName,
|
|
869
|
-
lineNumber:
|
|
870
|
+
lineNumber: 1129,
|
|
870
871
|
columnNumber: 5
|
|
871
872
|
}
|
|
872
873
|
}, _react["default"].createElement(FlatList, (0, _extends2["default"])({
|
|
@@ -903,7 +904,7 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
903
904
|
__self: _this,
|
|
904
905
|
__source: {
|
|
905
906
|
fileName: _jsxFileName,
|
|
906
|
-
lineNumber:
|
|
907
|
+
lineNumber: 1133,
|
|
907
908
|
columnNumber: 7
|
|
908
909
|
}
|
|
909
910
|
})), !loading && _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_reactNative.View, {
|
|
@@ -911,28 +912,28 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
911
912
|
__self: _this,
|
|
912
913
|
__source: {
|
|
913
914
|
fileName: _jsxFileName,
|
|
914
|
-
lineNumber:
|
|
915
|
+
lineNumber: 1184,
|
|
915
916
|
columnNumber: 11
|
|
916
917
|
}
|
|
917
918
|
}, _react["default"].createElement(StickyHeaderComponent, {
|
|
918
919
|
__self: _this,
|
|
919
920
|
__source: {
|
|
920
921
|
fileName: _jsxFileName,
|
|
921
|
-
lineNumber:
|
|
922
|
+
lineNumber: 1185,
|
|
922
923
|
columnNumber: 13
|
|
923
924
|
}
|
|
924
925
|
})), !disableTypingIndicator && TypingIndicator && _react["default"].createElement(TypingIndicatorContainer, {
|
|
925
926
|
__self: _this,
|
|
926
927
|
__source: {
|
|
927
928
|
fileName: _jsxFileName,
|
|
928
|
-
lineNumber:
|
|
929
|
+
lineNumber: 1188,
|
|
929
930
|
columnNumber: 13
|
|
930
931
|
}
|
|
931
932
|
}, _react["default"].createElement(TypingIndicator, {
|
|
932
933
|
__self: _this,
|
|
933
934
|
__source: {
|
|
934
935
|
fileName: _jsxFileName,
|
|
935
|
-
lineNumber:
|
|
936
|
+
lineNumber: 1189,
|
|
936
937
|
columnNumber: 15
|
|
937
938
|
}
|
|
938
939
|
})), _react["default"].createElement(ScrollToBottomButton, {
|
|
@@ -942,14 +943,14 @@ var MessageListWithContext = function MessageListWithContext(props) {
|
|
|
942
943
|
__self: _this,
|
|
943
944
|
__source: {
|
|
944
945
|
fileName: _jsxFileName,
|
|
945
|
-
lineNumber:
|
|
946
|
+
lineNumber: 1192,
|
|
946
947
|
columnNumber: 11
|
|
947
948
|
}
|
|
948
949
|
})), _react["default"].createElement(NetworkDownIndicator, {
|
|
949
950
|
__self: _this,
|
|
950
951
|
__source: {
|
|
951
952
|
fileName: _jsxFileName,
|
|
952
|
-
lineNumber:
|
|
953
|
+
lineNumber: 1199,
|
|
953
954
|
columnNumber: 7
|
|
954
955
|
}
|
|
955
956
|
}));
|
|
@@ -1058,7 +1059,7 @@ var MessageList = function MessageList(props) {
|
|
|
1058
1059
|
__self: _this,
|
|
1059
1060
|
__source: {
|
|
1060
1061
|
fileName: _jsxFileName,
|
|
1061
|
-
lineNumber:
|
|
1062
|
+
lineNumber: 1258,
|
|
1062
1063
|
columnNumber: 5
|
|
1063
1064
|
}
|
|
1064
1065
|
}));
|