1
- import { put , select , call , delay } from 'typed-redux-saga'
1
+ import { put , select , call } from 'typed-redux-saga'
2
2
import { messagesActions } from '../../messages/messages.slice'
3
3
import { publicChannelsSelectors } from '../publicChannels.selectors'
4
4
import { WriteMessagePayload , MessageType , PublicChannel , PublicChannelStorage } from '@quiet/types'
@@ -24,24 +24,6 @@ export function* sendIntroductionMessageSaga(): Generator {
24
24
channelId : generalChannel . id ,
25
25
}
26
26
27
- // FIXME: This is a quick fix for an issue that can be fixed by
28
- // unifying CHANNELS_STORED and CHANNELS_SUBSCRIBED events and
29
- // refactoring a bit. The problem is that the frontend sends a
30
- // message upon receiving the CHANNELS_STORED event, but the channel
31
- // hasn't been fully initialized/subscribed yet (it doesn't exist in
32
- // publicChannelsRepos on the backend so the backend fails to send
33
- // it). Ideally, I think we should only tell the frontend about
34
- // channels once they've been fully initialized. Once we fix that,
35
- // we can remove the following code.
36
- while ( true ) {
37
- const subscribedChannels = yield * select ( publicChannelsSelectors . subscribedChannels )
38
- if ( subscribedChannels . includes ( generalChannel . id ) ) {
39
- break
40
- }
41
- console . error ( 'Failed to send introduction message, general channel not subscribed. Retrying...' )
42
- yield * delay ( 500 )
43
- }
44
-
45
27
yield * put ( messagesActions . sendMessage ( payload ) )
46
28
yield * put ( identityActions . updateIdentity ( { ...identity , introMessageSent : true } ) )
47
29
}
0 commit comments