Skip to content

Commit 2da407e

Browse files
authored
Merge pull request #817 from GetStream/hopin-fixes
Hopin fixes
2 parents fbe8fb8 + 8d84730 commit 2da407e

File tree

4 files changed

+28
-15
lines changed

4 files changed

+28
-15
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
# Changelog
22

33

4+
## [5.1.0](https://github.com/GetStream/stream-chat-react/releases/tag/v5.1.0) 2021-03-30
5+
6+
### Feature
7+
8+
- Add type support for Moment.js date objects [#809](https://github.com/GetStream/stream-chat-react/pull/809)
9+
- Add i18n translation support for `ChannelPreview` [#810](https://github.com/GetStream/stream-chat-react/pull/810)
10+
- Allow `addNotification` function to be called anywhere within `Channel` [#811](https://github.com/GetStream/stream-chat-react/pull/811)
11+
- Hide `MessageActions` if no actions exist [#816](https://github.com/GetStream/stream-chat-react/pull/816)
12+
13+
### Chore
14+
15+
- Refactor failed message UI component [#811](https://github.com/GetStream/stream-chat-react/pull/811)
16+
- Remove extra `watchers` query [#817](https://github.com/GetStream/stream-chat-react/pull/817)
17+
- Prevent `queryUsers` from searching a null value [#817](https://github.com/GetStream/stream-chat-react/pull/817)
18+
19+
## [5.0.3](https://github.com/GetStream/stream-chat-react/releases/tag/v5.0.3) 2021-03-24
20+
21+
### Feature
22+
23+
- Add customization options for `renderText` function [#807](https://github.com/GetStream/stream-chat-react/pull/807)
24+
425
## [5.0.2](https://github.com/GetStream/stream-chat-react/releases/tag/v5.0.2) 2021-03-23
526

627
### Bug

src/components/Channel/Channel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ const ChannelInner = <
466466
try {
467467
queryResponse = await channel.query({
468468
messages: { id_lt: oldestID, limit: perPage },
469+
watchers: { limit: perPage },
469470
});
470471
} catch (e) {
471472
console.warn('message pagination request failed with error', e);

src/components/Channel/__tests__/Channel.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,9 @@ describe('Channel', () => {
407407
id_lt: messages[0].id,
408408
limit,
409409
},
410+
watchers: {
411+
limit,
412+
},
410413
}),
411414
);
412415

src/components/ChatAutoComplete/ChatAutoComplete.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
1+
import React, { useCallback, useMemo, useState } from 'react';
22
import debounce from 'lodash.debounce';
33

44
import { AutoCompleteTextarea } from '../AutoCompleteTextarea';
@@ -244,7 +244,7 @@ const UnMemoizedChatAutoComplete = <
244244
value,
245245
} = props;
246246

247-
const { channel, emojiConfig, thread } = useChannelContext<
247+
const { channel, emojiConfig } = useChannelContext<
248248
At,
249249
Ch,
250250
Co,
@@ -257,18 +257,6 @@ const UnMemoizedChatAutoComplete = <
257257

258258
const [searching, setSearching] = useState(false);
259259

260-
useEffect(() => {
261-
const getWatchers = async () => {
262-
await channel?.watch({
263-
watchers: { limit: 100, offset: 0 },
264-
});
265-
};
266-
267-
if (!thread) {
268-
getWatchers();
269-
}
270-
}, []);
271-
272260
const members = channel?.state?.members;
273261
const watchers = channel?.state?.watchers;
274262
const { emojiData, EmojiIndex } = emojiConfig || {};
@@ -341,7 +329,7 @@ const UnMemoizedChatAutoComplete = <
341329
query: string,
342330
onReady: (users: UserResponse<Us>[]) => void,
343331
) => {
344-
if (searching) return;
332+
if (!query || searching) return;
345333
setSearching(true);
346334

347335
try {

0 commit comments

Comments
 (0)