Skip to content

Commit c5aefa2

Browse files
authored
Merge pull request #762 from GetStream/develop
Next release
2 parents 54ef826 + e940f9a commit c5aefa2

File tree

10 files changed

+29
-10
lines changed

10 files changed

+29
-10
lines changed

package/src/components/Channel/Channel.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ import {
99
MessageResponse,
1010
SendMessageAPIResponse,
1111
StreamChat,
12+
Event as StreamEvent,
1213
Message as StreamMessage,
1314
} from 'stream-chat';
1415

16+
import { useAppStateListener } from '../../hooks/useAppStateListener';
1517
import { useCreateChannelContext } from './hooks/useCreateChannelContext';
1618
import { useCreateInputMessageInputContext } from './hooks/useCreateInputMessageInputContext';
1719
import { useCreateMessagesContext } from './hooks/useCreateMessagesContext';
@@ -608,6 +610,22 @@ const ChannelWithContext = <
608610
}
609611
}, [threadPropsExists]);
610612

613+
const handleAppBackground = useCallback(() => {
614+
if (channel) {
615+
channel.sendEvent({ parent_id: thread?.id, type: 'typing.stop' } as StreamEvent<
616+
At,
617+
Ch,
618+
Co,
619+
Ev,
620+
Me,
621+
Re,
622+
Us
623+
>);
624+
}
625+
}, [thread?.id, channelId]);
626+
627+
useAppStateListener(undefined, handleAppBackground);
628+
611629
/**
612630
* CHANNEL CONSTANTS
613631
*/

package/src/components/Chat/Chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
TranslationContextValue,
1414
TranslationProvider,
1515
} from '../../contexts/translationContext/TranslationContext';
16-
import { useStreami18n } from '../../utils/useStreami18n';
16+
import { useStreami18n } from '../../hooks/useStreami18n';
1717

1818
import { SDK } from '../../native';
1919
import { version } from '../../version.json';

package/src/components/Chat/hooks/useIsOnline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useState } from 'react';
22

3-
import { useAppStateListener } from './useAppStateListener';
3+
import { useAppStateListener } from '../../../hooks/useAppStateListener';
44
import { NetInfo } from '../../../native';
55

66
import type { NetInfoSubscription } from '@react-native-community/netinfo';

package/src/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ export * from './ChannelPreview/hooks/useChannelPreviewDisplayPresence';
7070
export * from './ChannelPreview/hooks/useLatestMessagePreview';
7171

7272
export * from './Chat/Chat';
73-
export * from './Chat/hooks/useAppStateListener';
7473
export * from './Chat/hooks/useCreateChatContext';
7574
export * from './Chat/hooks/useIsOnline';
7675
export * from './Chat/hooks/useMutedUsers';

package/src/contexts/overlayContext/OverlayProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import { ImageOverlaySelectedComponent as DefaultImageOverlaySelectedComponent }
2727
import { ImageSelectorIcon as DefaultImageSelectorIcon } from '../../components/AttachmentPicker/components/ImageSelectorIcon';
2828
import { ImageGallery } from '../../components/ImageGallery/ImageGallery';
2929
import { MessageOverlay } from '../../components/MessageOverlay/MessageOverlay';
30+
import { useStreami18n } from '../../hooks/useStreami18n';
3031
import { BlurView } from '../../native';
31-
import { useStreami18n } from '../../utils/useStreami18n';
3232

3333
import type BottomSheet from '@gorhom/bottom-sheet';
3434

package/src/hooks/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './useAppStateListener';
2+
export * from './useStreami18n';

package/src/utils/useStreami18n.ts renamed to package/src/hooks/useStreami18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useState } from 'react';
22

33
import type { TranslationContextValue } from '../contexts/translationContext/TranslationContext';
4-
import { Streami18n } from './Streami18n';
4+
import { Streami18n } from '../utils/Streami18n';
55

66
export const useStreami18n = ({
77
i18nInstance,

package/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './components';
2+
export * from './hooks';
23
export { registerNativeHandlers, NetInfo } from './native';
34
export * from './contexts';
45
export * from './emoji-data/compiled';
@@ -8,7 +9,6 @@ export * from './icons';
89
export * from './types/types';
910

1011
export * from './utils/Streami18n';
11-
export * from './utils/useStreami18n';
1212
export * from './utils/utils';
1313

1414
export { default as enTranslations } from './i18n/en.json';

release/prod.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
const semanticRelease = require('semantic-release');
2-
const configPromise = require('./release.config.js');
1+
const semanticRelease = require("semantic-release");
2+
const configPromise = require("./release.config.js");
33

44
configPromise.then((config) => {
55
const currentPackage = require(`${process.cwd()}/package.json`);
6-
const isSDK = currentPackage.name === 'stream-chat-react-native-core';
6+
const isSDK = currentPackage.name === "stream-chat-react-native-core";
77

88
const newConfig = {
99
...config,
10-
branches: ['master'],
10+
branches: ["master"],
1111
};
1212
if (process.env.GH_TOKEN || process.env.GITHUB_TOKEN) {
1313
newConfig.plugins.push([

0 commit comments

Comments
 (0)