Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
add constant THRESHOLD_FROM_BOTTOM and replace 1000 value
Browse files Browse the repository at this point in the history
  • Loading branch information
sridhar02 committed Jul 22, 2020
1 parent 4ef55e3 commit d6e49e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/toast_wrapper/toast_wrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {browserHistory} from 'utils/browser_history';
import LocalDateTime from 'components/local_date_time';

const TOAST_TEXT_COLLAPSE_WIDTH = 500;
const THRESHOLD_FROM_BOTTOM = 1000;

class ToastWrapper extends React.PureComponent {
static propTypes = {
Expand Down Expand Up @@ -85,7 +86,7 @@ class ToastWrapper extends React.PureComponent {

// show unread toast on mount when channel is not at bottom and unread count greater than 0
if (typeof showUnreadToast === 'undefined' && props.atBottom !== null) {
showUnreadToast = unreadCount > 0 && props.initScrollOffsetFromBottom > 1000;
showUnreadToast = unreadCount > 0 && props.initScrollOffsetFromBottom > THRESHOLD_FROM_BOTTOM;
}

if (typeof showMessageHistoryToast === 'undefined' && props.focusedPostId !== '' && props.atBottom !== null) {
Expand Down

0 comments on commit d6e49e2

Please sign in to comment.