From 3bac0182b5e93c9109bf00185c6f6d1dbf375f21 Mon Sep 17 00:00:00 2001
From: Eric Bailey <git@esb.lol>
Date: Wed, 8 May 2024 18:01:07 -0500
Subject: [🐴] Integrate event bus (#3915)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Integrate event bus

* Fixes

* Move events mgmt into Convo class

* Clean up poll interval updates

* Remove unused

* Remove annoying log
---
 src/state/messages/convo/index.tsx | 3 +++
 1 file changed, 3 insertions(+)

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

diff --git a/src/state/messages/convo/index.tsx b/src/state/messages/convo/index.tsx
index c4fe71d30..311e8ce05 100644
--- a/src/state/messages/convo/index.tsx
+++ b/src/state/messages/convo/index.tsx
@@ -5,6 +5,7 @@ import {useFocusEffect, useIsFocused} from '@react-navigation/native'
 
 import {Convo} from '#/state/messages/convo/agent'
 import {ConvoParams, ConvoState} from '#/state/messages/convo/types'
+import {useMessagesEventBus} from '#/state/messages/events'
 import {useMarkAsReadMutation} from '#/state/queries/messages/conversation'
 import {useAgent} from '#/state/session'
 import {useDmServiceUrlStorage} from '#/screens/Messages/Temp/useDmServiceUrlStorage'
@@ -26,6 +27,7 @@ export function ConvoProvider({
   const isScreenFocused = useIsFocused()
   const {serviceUrl} = useDmServiceUrlStorage()
   const {getAgent} = useAgent()
+  const events = useMessagesEventBus()
   const [convo] = useState(
     () =>
       new Convo({
@@ -33,6 +35,7 @@ export function ConvoProvider({
         agent: new BskyAgent({
           service: serviceUrl,
         }),
+        events,
         __tempFromUserDid: getAgent().session?.did!,
       }),
   )
-- 
cgit 1.4.1

