[MM-60603] Don't follow threads when marking them as read on focus (#28263)
* [MM-60603] Don't follow threads when marking them as read on focus * Fix tests * Fix lint * Fix the original bug in the API call
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3428cd15b6
Коммит
d58b048965
@@ -5,6 +5,7 @@ import {batchActions} from 'redux-batched-actions';
|
||||
|
||||
import {updateThreadRead} from 'mattermost-redux/actions/threads';
|
||||
import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams';
|
||||
import {getThread} from 'mattermost-redux/selectors/entities/threads';
|
||||
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
|
||||
import type {ThunkActionFunc} from 'mattermost-redux/types/actions';
|
||||
|
||||
@@ -56,8 +57,9 @@ export function markThreadAsRead(threadId: string): ThunkActionFunc<void, Global
|
||||
const state = getState();
|
||||
const currentUserId = getCurrentUserId(state);
|
||||
const currentTeamId = getCurrentTeamId(state);
|
||||
const thread = getThread(state, threadId);
|
||||
|
||||
if (isThreadOpen(state, threadId) && window.isActive && !isThreadManuallyUnread(state, threadId)) {
|
||||
if (thread && isThreadOpen(state, threadId) && window.isActive && !isThreadManuallyUnread(state, threadId)) {
|
||||
// mark thread as read on the server
|
||||
dispatch(updateThreadRead(currentUserId, currentTeamId, threadId, Date.now()));
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user