MM-49063 Silence warning when lastViewedAt is undefined (#24252)
* MM-49063 Silence warning when lastViewedAt is undefined * Fix type error
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e211b867b8
Коммит
dec13f8c9c
@@ -36,7 +36,7 @@ const memoizedGetLatestPostId = memoizeResult((postIds: string[]) => getLatestPo
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
focusedPostId?: string;
|
focusedPostId?: string;
|
||||||
unreadChunkTimeStamp: number;
|
unreadChunkTimeStamp?: number;
|
||||||
changeUnreadChunkTimeStamp: (lastViewedAt: number) => void;
|
changeUnreadChunkTimeStamp: (lastViewedAt: number) => void;
|
||||||
channelId: string;
|
channelId: string;
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,10 @@ function makeMapStateToProps() {
|
|||||||
atOldestPost = Boolean(chunk.oldest);
|
atOldestPost = Boolean(chunk.oldest);
|
||||||
}
|
}
|
||||||
|
|
||||||
const shouldHideNewMessageIndicator = shouldStartFromBottomWhenUnread && !isPostsChunkIncludingUnreadsPosts(state, chunk!, unreadChunkTimeStamp);
|
let shouldHideNewMessageIndicator = false;
|
||||||
|
if (unreadChunkTimeStamp != null) {
|
||||||
|
shouldHideNewMessageIndicator = shouldStartFromBottomWhenUnread && !isPostsChunkIncludingUnreadsPosts(state, chunk!, unreadChunkTimeStamp);
|
||||||
|
}
|
||||||
|
|
||||||
if (postIds) {
|
if (postIds) {
|
||||||
formattedPostIds = preparePostIdsForPostList(state, {postIds, lastViewedAt, indicateNewMessages: !shouldHideNewMessageIndicator});
|
formattedPostIds = preparePostIdsForPostList(state, {postIds, lastViewedAt, indicateNewMessages: !shouldHideNewMessageIndicator});
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {Preferences} from 'utils/constants';
|
|||||||
import PostList from './post_list';
|
import PostList from './post_list';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
lastViewedAt: number;
|
lastViewedAt?: number;
|
||||||
channelLoading: boolean;
|
channelLoading: boolean;
|
||||||
channelId: string;
|
channelId: string;
|
||||||
focusedPostId?: string;
|
focusedPostId?: string;
|
||||||
@@ -18,7 +18,7 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface State {
|
interface State {
|
||||||
unreadChunkTimeStamp: number;
|
unreadChunkTimeStamp?: number;
|
||||||
loaderForChangeOfPostsChunk: boolean;
|
loaderForChangeOfPostsChunk: boolean;
|
||||||
channelLoading: boolean;
|
channelLoading: boolean;
|
||||||
shouldStartFromBottomWhenUnread: boolean;
|
shouldStartFromBottomWhenUnread: boolean;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user