Skip to content

Commit 7ce9bc9

Browse files
authored
fix: revert back to old pagination defaults (#3421)
## 🎯 Goal <!-- Describe why we are making this change --> ## πŸ›  Implementation details <!-- Provide a description of the implementation --> ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## πŸ§ͺ Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## β˜‘οΈ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
1 parent 04c28b1 commit 7ce9bc9

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

β€Žexamples/SampleApp/yarn.lockβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8349,10 +8349,10 @@ stream-chat-react-native-core@8.1.0:
83498349
version "0.0.0"
83508350
uid ""
83518351

8352-
stream-chat@^9.27.2:
8353-
version "9.27.2"
8354-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-9.27.2.tgz#5b41173e513f3606c47c93f391693b589e663968"
8355-
integrity sha512-OdALDzg8lO8CAdl8deydJ1+O4wJ7mM9dPLeCwDppq/OQ4aFIS9X38P+IdXPcOCsgSS97UoVUuxD2/excC5PEeg==
8352+
stream-chat@^9.33.0:
8353+
version "9.35.1"
8354+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-9.35.1.tgz#d828854a9c27ea7e45e6642d9107966c6606f552"
8355+
integrity sha512-649sgO7+llFuW+y/Ja0K4d94aUC+EMxYUVo5mq5AFGT86vUAIXmRIMVHYHA/jw4MYoqfWAFrDK6L9Rhyn/eMkQ==
83568356
dependencies:
83578357
"@types/jsonwebtoken" "^9.0.8"
83588358
"@types/ws" "^8.5.14"

β€Žpackage/src/components/Channel/__tests__/useMessageListPagination.test.jsβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ describe('useMessageListPagination', () => {
161161

162162
await waitFor(() => {
163163
expect(queryFn).toHaveBeenCalledWith({
164-
messages: { id_lt: messages[0].id },
165-
watchers: {},
164+
messages: { id_lt: messages[0].id, limit: 25 },
165+
watchers: { limit: 25 },
166166
});
167167
expect(result.current.state.hasMore).toBe(true);
168168
expect(result.current.state.messages.length).toBe(40);
@@ -252,8 +252,8 @@ describe('useMessageListPagination', () => {
252252

253253
await waitFor(() => {
254254
expect(queryFn).toHaveBeenCalledWith({
255-
messages: { id_gt: messages[messages.length - 1].id },
256-
watchers: {},
255+
messages: { id_gt: messages[messages.length - 1].id, limit: 10 },
256+
watchers: { limit: 10 },
257257
});
258258
expect(result.current.state.hasMore).toBe(true);
259259
expect(result.current.state.messages.length).toBe(40);

β€Žpackage/src/components/Channel/hooks/useMessageListPagination.tsxβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const useMessageListPagination = ({ channel }: { channel: Channel }) => {
7474
/**
7575
* This function loads more messages before the first message in current channel state.
7676
*/
77-
const loadMore = useStableCallback(async (limit?: number) => {
77+
const loadMore = useStableCallback(async (limit: number = 25) => {
7878
if (!channel.state.messagePagination.hasPrev) {
7979
return;
8080
}
@@ -103,7 +103,7 @@ export const useMessageListPagination = ({ channel }: { channel: Channel }) => {
103103
/**
104104
* This function loads more messages after the most recent message in current channel state.
105105
*/
106-
const loadMoreRecent = useStableCallback(async (limit?: number) => {
106+
const loadMoreRecent = useStableCallback(async (limit: number = 10) => {
107107
if (!channel.state.messagePagination.hasNext) {
108108
return;
109109
}

0 commit comments

Comments
Β (0)