stream-chat 10.0.0 → 10.0.1
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/dist/cjs/index.browser.js +8 -3
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +8 -3
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +8 -3
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/pagination/paginators/MessagePaginator.d.ts +3 -1
- package/package.json +1 -1
- package/src/pagination/paginators/MessagePaginator.ts +7 -2
|
@@ -220,7 +220,9 @@ export declare class MessagePaginator extends MessageIntervalPaginator {
|
|
|
220
220
|
/**
|
|
221
221
|
* A message the paginator does not hold yet, at or after {@link latestMessageAt} (as known before
|
|
222
222
|
* it arrives), while no loaded interval reaches the newest message. It is then the newest message,
|
|
223
|
-
* so it starts the newest interval, as a page holding it would (see {@link pageReachesHead}).
|
|
223
|
+
* so it starts the newest interval, as a page holding it would (see {@link pageReachesHead}). In a
|
|
224
|
+
* channel whose newest page was loaded empty, with no newest message time known, any message is
|
|
225
|
+
* the newest.
|
|
224
226
|
*/
|
|
225
227
|
private isNewNewestMessage;
|
|
226
228
|
/**
|
package/package.json
CHANGED
|
@@ -411,13 +411,18 @@ export class MessagePaginator extends MessageIntervalPaginator {
|
|
|
411
411
|
/**
|
|
412
412
|
* A message the paginator does not hold yet, at or after {@link latestMessageAt} (as known before
|
|
413
413
|
* it arrives), while no loaded interval reaches the newest message. It is then the newest message,
|
|
414
|
-
* so it starts the newest interval, as a page holding it would (see {@link pageReachesHead}).
|
|
414
|
+
* so it starts the newest interval, as a page holding it would (see {@link pageReachesHead}). In a
|
|
415
|
+
* channel whose newest page was loaded empty, with no newest message time known, any message is
|
|
416
|
+
* the newest.
|
|
415
417
|
*/
|
|
416
418
|
private isNewNewestMessage(message: LocalMessage): boolean {
|
|
417
419
|
if (this.anchoredHeadItem !== undefined || this.getItem(message.id)) return false;
|
|
418
420
|
const latestMessageAt = this.latestMessageAt;
|
|
421
|
+
if (latestMessageAt === null) {
|
|
422
|
+
return this.items?.length === 0 && !this.hasMoreHead;
|
|
423
|
+
}
|
|
419
424
|
const createdAt = getMessageCreatedAtTimestamp(message);
|
|
420
|
-
return
|
|
425
|
+
return createdAt !== null && createdAt >= latestMessageAt;
|
|
421
426
|
}
|
|
422
427
|
|
|
423
428
|
/**
|