@poolse/react 3.5.0 → 3.6.0
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/CHANGELOG.md +8 -0
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to `@poolse/react` are documented here. Format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
|
|
5
5
|
[semver](https://semver.org).
|
|
6
6
|
|
|
7
|
+
## [3.6.0] - 2026-11-21
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- `useMessages().loadMore()` no longer inserts a page twice when it overlaps
|
|
12
|
+
another `loadMore()` or `loadUntil()` (e.g. scrolling up while jumping to
|
|
13
|
+
the first unread).
|
|
14
|
+
|
|
7
15
|
## [3.5.0] - 2026-11-21
|
|
8
16
|
|
|
9
17
|
### Added
|
package/dist/index.cjs
CHANGED
|
@@ -620,9 +620,15 @@ function useMessages(conversationId) {
|
|
|
620
620
|
return;
|
|
621
621
|
}
|
|
622
622
|
const older = [...page.data].reverse();
|
|
623
|
-
setMessages((prev) =>
|
|
623
|
+
setMessages((prev) => {
|
|
624
|
+
const have = new Set(prev.map((m) => m.id));
|
|
625
|
+
return [...older.filter((m) => !have.has(m.id)), ...prev];
|
|
626
|
+
});
|
|
624
627
|
setHasMore(page.data.length === PAGE_SIZE);
|
|
625
|
-
|
|
628
|
+
const first = older[0]?.sequence;
|
|
629
|
+
const current = oldestSequenceRef.current;
|
|
630
|
+
if (first != null)
|
|
631
|
+
oldestSequenceRef.current = current == null ? first : Math.min(current, first);
|
|
626
632
|
}, [chat, conversationId, hasMore, loading]);
|
|
627
633
|
const loadUntil = react.useCallback(
|
|
628
634
|
async (messageId, maxPages = 20) => {
|