File tree Expand file tree Collapse file tree 10 files changed +29
-10
lines changed Expand file tree Collapse file tree 10 files changed +29
-10
lines changed Original file line number Diff line number Diff 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' ;
1517import { useCreateChannelContext } from './hooks/useCreateChannelContext' ;
1618import { useCreateInputMessageInputContext } from './hooks/useCreateInputMessageInputContext' ;
1719import { 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 */
Original file line number Diff line number Diff 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
1818import { SDK } from '../../native' ;
1919import { version } from '../../version.json' ;
Original file line number Diff line number Diff line change 11import { useEffect , useState } from 'react' ;
22
3- import { useAppStateListener } from './useAppStateListener' ;
3+ import { useAppStateListener } from '../../../hooks /useAppStateListener' ;
44import { NetInfo } from '../../../native' ;
55
66import type { NetInfoSubscription } from '@react-native-community/netinfo' ;
Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ export * from './ChannelPreview/hooks/useChannelPreviewDisplayPresence';
7070export * from './ChannelPreview/hooks/useLatestMessagePreview' ;
7171
7272export * from './Chat/Chat' ;
73- export * from './Chat/hooks/useAppStateListener' ;
7473export * from './Chat/hooks/useCreateChatContext' ;
7574export * from './Chat/hooks/useIsOnline' ;
7675export * from './Chat/hooks/useMutedUsers' ;
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ import { ImageOverlaySelectedComponent as DefaultImageOverlaySelectedComponent }
2727import { ImageSelectorIcon as DefaultImageSelectorIcon } from '../../components/AttachmentPicker/components/ImageSelectorIcon' ;
2828import { ImageGallery } from '../../components/ImageGallery/ImageGallery' ;
2929import { MessageOverlay } from '../../components/MessageOverlay/MessageOverlay' ;
30+ import { useStreami18n } from '../../hooks/useStreami18n' ;
3031import { BlurView } from '../../native' ;
31- import { useStreami18n } from '../../utils/useStreami18n' ;
3232
3333import type BottomSheet from '@gorhom/bottom-sheet' ;
3434
Original file line number Diff line number Diff line change 1+ export * from './useAppStateListener' ;
2+ export * from './useStreami18n' ;
File renamed without changes.
Original file line number Diff line number Diff line change 11import { useEffect , useState } from 'react' ;
22
33import type { TranslationContextValue } from '../contexts/translationContext/TranslationContext' ;
4- import { Streami18n } from './Streami18n' ;
4+ import { Streami18n } from '../utils /Streami18n' ;
55
66export const useStreami18n = ( {
77 i18nInstance,
Original file line number Diff line number Diff line change 11export * from './components' ;
2+ export * from './hooks' ;
23export { registerNativeHandlers , NetInfo } from './native' ;
34export * from './contexts' ;
45export * from './emoji-data/compiled' ;
@@ -8,7 +9,6 @@ export * from './icons';
89export * from './types/types' ;
910
1011export * from './utils/Streami18n' ;
11- export * from './utils/useStreami18n' ;
1212export * from './utils/utils' ;
1313
1414export { default as enTranslations } from './i18n/en.json' ;
Original file line number Diff line number Diff line change 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
44configPromise . 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 ( [
You can’t perform that action at this time.
0 commit comments