From 165fdb704959837d244eebf12f61803676b15366 Mon Sep 17 00:00:00 2001
From: Eric Bailey <git@esb.lol>
Date: Tue, 7 May 2024 20:25:58 -0500
Subject: [🐴] Integrate global event bus (#3904)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Conditionally run global event bus

* Add current convo id context, bundle providers
---
 src/state/messages/index.tsx | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'src/state/messages/index.tsx')

diff --git a/src/state/messages/index.tsx b/src/state/messages/index.tsx
index 95ebf0afd..7145e5d88 100644
--- a/src/state/messages/index.tsx
+++ b/src/state/messages/index.tsx
@@ -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>
+  )
+}
-- 
cgit 1.4.1

