[🐴] Integrate global event bus (#3904)
* Conditionally run global event bus * Add current convo id context, bundle providers
This commit is contained in:
parent
37f22ca224
commit
165fdb7049
6 changed files with 112 additions and 31 deletions
|
@ -4,6 +4,8 @@ import {BskyAgent} from '@atproto-labs/api'
|
|||
import {useFocusEffect, useIsFocused} from '@react-navigation/native'
|
||||
|
||||
import {Convo, ConvoParams, ConvoState} from '#/state/messages/convo'
|
||||
import {CurrentConvoIdProvider} from '#/state/messages/current-convo-id'
|
||||
import {MessagesEventBusProvider} from '#/state/messages/events'
|
||||
import {useAgent} from '#/state/session'
|
||||
import {useDmServiceUrlStorage} from '#/screens/Messages/Temp/useDmServiceUrlStorage'
|
||||
|
||||
|
@ -66,3 +68,11 @@ export function ChatProvider({
|
|||
|
||||
return <ChatContext.Provider value={service}>{children}</ChatContext.Provider>
|
||||
}
|
||||
|
||||
export function MessagesProvider({children}: {children: React.ReactNode}) {
|
||||
return (
|
||||
<CurrentConvoIdProvider>
|
||||
<MessagesEventBusProvider>{children}</MessagesEventBusProvider>
|
||||
</CurrentConvoIdProvider>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue