Skip to content

Commit 7715ec7

Browse files
authored
chore: use server defaults in channel manager (#1689)
## CLA - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required). - [ ] Code changes are tested ## Description of the changes, What, Why and How? This PR makes sure no embedded defaults are being used within `channel_manager` when querying channels. Instead, we'll default to whatever defaults the server provides. ## Changelog -
1 parent de5d6ac commit 7715ec7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/channel_manager.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ export const DEFAULT_CHANNEL_MANAGER_OPTIONS = {
149149
};
150150

151151
export const DEFAULT_CHANNEL_MANAGER_PAGINATION_OPTIONS = {
152-
limit: 10,
153152
offset: 0,
154153
};
155154

@@ -293,7 +292,7 @@ export class ChannelManager extends WithSubscriptions {
293292
channels,
294293
pagination: {
295294
...pagination,
296-
hasNext: (channels?.length ?? 0) >= limit,
295+
hasNext: (channels?.length ?? 0) >= (limit ?? 1),
297296
isLoading: false,
298297
options: newOptions,
299298
},
@@ -446,7 +445,7 @@ export class ChannelManager extends WithSubscriptions {
446445
channels: uniqBy<Channel>([...(channels || []), ...nextChannels], 'cid'),
447446
pagination: {
448447
...pagination,
449-
hasNext: (nextChannels?.length ?? 0) >= limit,
448+
hasNext: (nextChannels?.length ?? 0) >= (limit ?? 1),
450449
isLoading: false,
451450
isLoadingNext: false,
452451
options: newOptions,

0 commit comments

Comments
 (0)