diff --git a/src/store/chat/saga.test.ts b/src/store/chat/saga.test.ts index 29864636b..2ffd55041 100644 --- a/src/store/chat/saga.test.ts +++ b/src/store/chat/saga.test.ts @@ -81,7 +81,7 @@ describe(performValidateActiveConversation, () => { .call(getRoomIdForAlias, '#' + alias) .not.call(apiJoinRoom, conversationId) .put(rawSetActiveConversationId(conversationId)) - .spawn(markConversationAsRead, conversationId) + .call(markConversationAsRead, conversationId) .run(); expect(storeState.chat.activeConversationId).toBe(conversationId); @@ -170,7 +170,7 @@ describe(performValidateActiveConversation, () => { [matchers.call.fn(markConversationAsRead), undefined], ]) .put(rawSetActiveConversationId('social-channel')) - .spawn(markConversationAsRead, 'social-channel') + .call(markConversationAsRead, 'social-channel') .not.call(openFirstConversation) .run(); }); @@ -193,7 +193,7 @@ describe(performValidateActiveConversation, () => { [matchers.call.fn(getHistory), history], ]) .put(rawSetActiveConversationId('convo-1')) - .spawn(markConversationAsRead, 'convo-1') + .call(markConversationAsRead, 'convo-1') .run(); }); @@ -229,7 +229,7 @@ describe(performValidateActiveConversation, () => { }, ]) .not.put(rawSetActiveConversationId('convo-1')) - .not.spawn(markConversationAsRead, 'convo-1') + .call(markConversationAsRead, 'convo-1') .run(); }); }); diff --git a/src/store/chat/saga.ts b/src/store/chat/saga.ts index 35979a23f..dbb45fccd 100644 --- a/src/store/chat/saga.ts +++ b/src/store/chat/saga.ts @@ -217,9 +217,10 @@ export function* performValidateActiveConversation(activeConversationId: string) // check if path has changed before setting active conversation if (currentPathNow === originalPath) { yield put(rawSetActiveConversationId(conversationId)); - // Mark conversation as read, now that it has been set as active - yield spawn(markConversationAsRead, conversationId); } + + // Mark conversation as read, now that it has been set as active + yield call(markConversationAsRead, conversationId); } export function* closeErrorDialog() {