pleroma/priv/static/packs/features/home_timeline.js.map
2020-05-20 07:55:14 +02:00

1 line
No EOL
40 KiB
Text

{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/getting_started/components/announcements.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/components/icon_with_badge.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/home_timeline/components/column_settings.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/home_timeline/containers/column_settings_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/getting_started/containers/announcements_container.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/home_timeline/index.js"],"names":["messages","defineMessages","close","previous","next","Content","c","node","mention","e","context","router","button","ctrlKey","metaKey","preventDefault","history","push","get","hashtag","replace","status","target","src","getAttribute","componentDidMount","this","_updateLinks","_updateEmojis","componentDidUpdate","autoPlayGif","emojis","querySelectorAll","i","length","emoji","classList","contains","add","addEventListener","handleEmojiMouseEnter","handleEmojiMouseLeave","links","link","props","announcement","find","item","href","onMentionClick","bind","setAttribute","textContent","previousSibling","onHashtagClick","text","onStatusClick","render","className","ref","setRef","dangerouslySetInnerHTML","__html","ImmutablePureComponent","PropTypes","object","ImmutablePropTypes","map","isRequired","assetHost","process","env","CDN_HOST","Emoji","emojiMap","hovered","unicodeMapping","filename","shortCode","title","draggable","alt","getIn","React","PureComponent","Reaction","reaction","announcementId","addReaction","removeReaction","setState","classNames","active","onClick","handleClick","onMouseEnter","handleMouseEnter","onMouseLeave","handleMouseLeave","style","state","value","string","func","ReactionsBar","data","native","willEnter","scale","reduceMotion","willLeave","spring","stiffness","damping","visibleReactions","reactions","filter","x","styles","key","toArray","items","isEmpty","transform","position","size","onPickEmoji","handleEmojiPick","id","list","Announcement","unread","selected","startsAt","Date","endsAt","now","hasTimeRange","skipYear","getFullYear","skipEndDate","getDate","getMonth","skipTime","defaultMessage","hour12","year","undefined","month","day","hour","minute","intl","bool","Announcements","injectIntl","index","announcements","getDerivedStateFromProps","_markAnnouncementAsRead","dismissAnnouncement","mascot","animateHeight","adjustHeight","onChangeIndex","handleChangeIndex","idx","disabled","formatMessage","icon","handlePrevClick","handleNextClick","IconWithBadge","num","count","fixedWidth","ColumnSettings","settings","onChange","prefix","settingPath","label","connect","dispatch","checked","changeSetting","onSave","saveSettings","customEmojiMap","createSelector","reduce","set","ImmutableMap","name","show_announcements","hide_announcements","HomeTimeline","hasUnread","isPartial","hasAnnouncements","unreadAnnouncements","showAnnouncements","columnId","removeColumn","addColumn","dir","moveColumn","column","scrollTop","maxId","expandHomeTimeline","stopPropagation","toggleShowAnnouncements","fetchAnnouncements","_checkIfReloadNeeded","prevProps","componentWillUnmount","_stopPolling","wasPartial","polling","setInterval","clearInterval","shouldUpdateScroll","multiColumn","pinned","announcementsButton","aria-label","aria-pressed","handleToggleAnnouncementsClick","bindToDocument","onPin","handlePin","onMove","handleMove","handleHeaderClick","extraButton","appendContent","trackScroll","scrollKey","onLoadMore","handleLoadMore","timelineId","emptyMessage","values","public","Link","to"],"mappings":"2zBAiBA,IAAMA,EAAWC,YAAe,CAC9BC,MAAM,CAAD,4CACLC,SAAS,CAAD,kDACRC,KAAK,CAAD,4CAGAC,E,8MAUK,SAAAC,GACP,EAAKC,KAAOD,K,6CA2EG,SAACE,EAASC,IACrB,EAAKC,QAAQC,QAAuB,IAAbF,EAAEG,QAAkBH,EAAEI,SAAWJ,EAAEK,UAC5DL,EAAEM,iBACF,EAAKL,QAAQC,OAAOK,QAAQC,KAA5B,aAA8CT,EAAQU,IAAI,W,6CAI7C,SAACC,EAASV,GACzBU,EAAUA,EAAQC,QAAQ,KAAM,KAE5B,EAAKV,QAAQC,QAAuB,IAAbF,EAAEG,QAAkBH,EAAEI,SAAWJ,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nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ReactSwipeableViews from 'react-swipeable-views';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport IconButton from 'mastodon/components/icon_button';\nimport Icon from 'mastodon/components/icon';\nimport { defineMessages, injectIntl, FormattedMessage, FormattedDate } from 'react-intl';\nimport { autoPlayGif, reduceMotion } from 'mastodon/initial_state';\nimport { mascot } from 'mastodon/initial_state';\nimport unicodeMapping from 'mastodon/features/emoji/emoji_unicode_mapping_light';\nimport classNames from 'classnames';\nimport EmojiPickerDropdown from 'mastodon/features/compose/containers/emoji_picker_dropdown_container';\nimport AnimatedNumber from 'mastodon/components/animated_number';\nimport TransitionMotion from 'react-motion/lib/TransitionMotion';\nimport spring from 'react-motion/lib/spring';\n\nconst messages = defineMessages({\n close: { id: 'lightbox.close', defaultMessage: 'Close' },\n previous: { id: 'lightbox.previous', defaultMessage: 'Previous' },\n next: { id: 'lightbox.next', defaultMessage: 'Next' },\n});\n\nclass Content extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n announcement: ImmutablePropTypes.map.isRequired,\n };\n\n setRef = c => {\n this.node = c;\n }\n\n componentDidMount () {\n this._updateLinks();\n this._updateEmojis();\n }\n\n componentDidUpdate () {\n this._updateLinks();\n this._updateEmojis();\n }\n\n _updateEmojis () {\n const node = this.node;\n\n if (!node || autoPlayGif) {\n return;\n }\n\n const emojis = node.querySelectorAll('.custom-emoji');\n\n for (var i = 0; i < emojis.length; i++) {\n let emoji = emojis[i];\n\n if (emoji.classList.contains('status-emoji')) {\n continue;\n }\n\n emoji.classList.add('status-emoji');\n\n emoji.addEventListener('mouseenter', this.handleEmojiMouseEnter, false);\n emoji.addEventListener('mouseleave', this.handleEmojiMouseLeave, false);\n }\n }\n\n _updateLinks () {\n const node = this.node;\n\n if (!node) {\n return;\n }\n\n const links = node.querySelectorAll('a');\n\n for (var i = 0; i < links.length; ++i) {\n let link = links[i];\n\n if (link.classList.contains('status-link')) {\n continue;\n }\n\n link.classList.add('status-link');\n\n let mention = this.props.announcement.get('mentions').find(item => link.href === item.get('url'));\n\n if (mention) {\n link.addEventListener('click', this.onMentionClick.bind(this, mention), false);\n link.setAttribute('title', mention.get('acct'));\n } else if (link.textContent[0] === '#' || (link.previousSibling && link.previousSibling.textContent && link.previousSibling.textContent[link.previousSibling.textContent.length - 1] === '#')) {\n link.addEventListener('click', this.onHashtagClick.bind(this, link.text), false);\n } else {\n let status = this.props.announcement.get('statuses').find(item => link.href === item.get('url'));\n if (status) {\n link.addEventListener('click', this.onStatusClick.bind(this, status), false);\n }\n link.setAttribute('title', link.href);\n link.classList.add('unhandled-link');\n }\n\n link.setAttribute('target', '_blank');\n link.setAttribute('rel', 'noopener noreferrer');\n }\n }\n\n onMentionClick = (mention, e) => {\n if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {\n e.preventDefault();\n this.context.router.history.push(`/accounts/${mention.get('id')}`);\n }\n }\n\n onHashtagClick = (hashtag, e) => {\n hashtag = hashtag.replace(/^#/, '');\n\n if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {\n e.preventDefault();\n this.context.router.history.push(`/timelines/tag/${hashtag}`);\n }\n }\n\n onStatusClick = (status, e) => {\n if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {\n e.preventDefault();\n this.context.router.history.push(`/statuses/${status.get('id')}`);\n }\n }\n\n handleEmojiMouseEnter = ({ target }) => {\n target.src = target.getAttribute('data-original');\n }\n\n handleEmojiMouseLeave = ({ target }) => {\n target.src = target.getAttribute('data-static');\n }\n\n render () {\n const { announcement } = this.props;\n\n return (\n <div\n className='announcements__item__content'\n ref={this.setRef}\n dangerouslySetInnerHTML={{ __html: announcement.get('contentHtml') }}\n />\n );\n }\n\n}\n\nconst assetHost = process.env.CDN_HOST || '';\n\nclass Emoji extends React.PureComponent {\n\n static propTypes = {\n emoji: PropTypes.string.isRequired,\n emojiMap: ImmutablePropTypes.map.isRequired,\n hovered: PropTypes.bool.isRequired,\n };\n\n render () {\n const { emoji, emojiMap, hovered } = this.props;\n\n if (unicodeMapping[emoji]) {\n const { filename, shortCode } = unicodeMapping[this.props.emoji];\n const title = shortCode ? `:${shortCode}:` : '';\n\n return (\n <img\n draggable='false'\n className='emojione'\n alt={emoji}\n title={title}\n src={`${assetHost}/emoji/${filename}.svg`}\n />\n );\n } else if (emojiMap.get(emoji)) {\n const filename = (autoPlayGif || hovered) ? emojiMap.getIn([emoji, 'url']) : emojiMap.getIn([emoji, 'static_url']);\n const shortCode = `:${emoji}:`;\n\n return (\n <img\n draggable='false'\n className='emojione custom-emoji'\n alt={shortCode}\n title={shortCode}\n src={filename}\n />\n );\n } else {\n return null;\n }\n }\n\n}\n\nclass Reaction extends ImmutablePureComponent {\n\n static propTypes = {\n announcementId: PropTypes.string.isRequired,\n reaction: ImmutablePropTypes.map.isRequired,\n addReaction: PropTypes.func.isRequired,\n removeReaction: PropTypes.func.isRequired,\n emojiMap: ImmutablePropTypes.map.isRequired,\n style: PropTypes.object,\n };\n\n state = {\n hovered: false,\n };\n\n handleClick = () => {\n const { reaction, announcementId, addReaction, removeReaction } = this.props;\n\n if (reaction.get('me')) {\n removeReaction(announcementId, reaction.get('name'));\n } else {\n addReaction(announcementId, reaction.get('name'));\n }\n }\n\n handleMouseEnter = () => this.setState({ hovered: true })\n\n handleMouseLeave = () => this.setState({ hovered: false })\n\n render () {\n const { reaction } = this.props;\n\n let shortCode = reaction.get('name');\n\n if (unicodeMapping[shortCode]) {\n shortCode = unicodeMapping[shortCode].shortCode;\n }\n\n return (\n <button className={classNames('reactions-bar__item', { active: reaction.get('me') })} onClick={this.handleClick} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave} title={`:${shortCode}:`} style={this.props.style}>\n <span className='reactions-bar__item__emoji'><Emoji hovered={this.state.hovered} emoji={reaction.get('name')} emojiMap={this.props.emojiMap} /></span>\n <span className='reactions-bar__item__count'><AnimatedNumber value={reaction.get('count')} /></span>\n </button>\n );\n }\n\n}\n\nclass ReactionsBar extends ImmutablePureComponent {\n\n static propTypes = {\n announcementId: PropTypes.string.isRequired,\n reactions: ImmutablePropTypes.list.isRequired,\n addReaction: PropTypes.func.isRequired,\n removeReaction: PropTypes.func.isRequired,\n emojiMap: ImmutablePropTypes.map.isRequired,\n };\n\n handleEmojiPick = data => {\n const { addReaction, announcementId } = this.props;\n addReaction(announcementId, data.native.replace(/:/g, ''));\n }\n\n willEnter () {\n return { scale: reduceMotion ? 1 : 0 };\n }\n\n willLeave () {\n return { scale: reduceMotion ? 0 : spring(0, { stiffness: 170, damping: 26 }) };\n }\n\n render () {\n const { reactions } = this.props;\n const visibleReactions = reactions.filter(x => x.get('count') > 0);\n\n const styles = visibleReactions.map(reaction => ({\n key: reaction.get('name'),\n data: reaction,\n style: { scale: reduceMotion ? 1 : spring(1, { stiffness: 150, damping: 13 }) },\n })).toArray();\n\n return (\n <TransitionMotion styles={styles} willEnter={this.willEnter} willLeave={this.willLeave}>\n {items => (\n <div className={classNames('reactions-bar', { 'reactions-bar--empty': visibleReactions.isEmpty() })}>\n {items.map(({ key, data, style }) => (\n <Reaction\n key={key}\n reaction={data}\n style={{ transform: `scale(${style.scale})`, position: style.scale < 0.5 ? 'absolute' : 'static' }}\n announcementId={this.props.announcementId}\n addReaction={this.props.addReaction}\n removeReaction={this.props.removeReaction}\n emojiMap={this.props.emojiMap}\n />\n ))}\n\n {visibleReactions.size < 8 && <EmojiPickerDropdown onPickEmoji={this.handleEmojiPick} button={<Icon id='plus' />} />}\n </div>\n )}\n </TransitionMotion>\n );\n }\n\n}\n\nclass Announcement extends ImmutablePureComponent {\n\n static propTypes = {\n announcement: ImmutablePropTypes.map.isRequired,\n emojiMap: ImmutablePropTypes.map.isRequired,\n addReaction: PropTypes.func.isRequired,\n removeReaction: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n selected: PropTypes.bool,\n };\n\n state = {\n unread: !this.props.announcement.get('read'),\n };\n\n componentDidUpdate () {\n const { selected, announcement } = this.props;\n if (!selected && this.state.unread !== !announcement.get('read')) {\n this.setState({ unread: !announcement.get('read') });\n }\n }\n\n render () {\n const { announcement } = this.props;\n const { unread } = this.state;\n const startsAt = announcement.get('starts_at') && new Date(announcement.get('starts_at'));\n const endsAt = announcement.get('ends_at') && new Date(announcement.get('ends_at'));\n const now = new Date();\n const hasTimeRange = startsAt && endsAt;\n const skipYear = hasTimeRange && startsAt.getFullYear() === endsAt.getFullYear() && endsAt.getFullYear() === now.getFullYear();\n const skipEndDate = hasTimeRange && startsAt.getDate() === endsAt.getDate() && startsAt.getMonth() === endsAt.getMonth() && startsAt.getFullYear() === endsAt.getFullYear();\n const skipTime = announcement.get('all_day');\n\n return (\n <div className='announcements__item'>\n <strong className='announcements__item__range'>\n <FormattedMessage id='announcement.announcement' defaultMessage='Announcement' />\n {hasTimeRange && <span> · <FormattedDate value={startsAt} hour12={false} year={(skipYear || startsAt.getFullYear() === now.getFullYear()) ? undefined : 'numeric'} month='short' day='2-digit' hour={skipTime ? undefined : '2-digit'} minute={skipTime ? undefined : '2-digit'} /> - <FormattedDate value={endsAt} hour12={false} year={(skipYear || endsAt.getFullYear() === now.getFullYear()) ? undefined : 'numeric'} month={skipEndDate ? undefined : 'short'} day={skipEndDate ? undefined : '2-digit'} hour={skipTime ? undefined : '2-digit'} minute={skipTime ? undefined : '2-digit'} /></span>}\n </strong>\n\n <Content announcement={announcement} />\n\n <ReactionsBar\n reactions={announcement.get('reactions')}\n announcementId={announcement.get('id')}\n addReaction={this.props.addReaction}\n removeReaction={this.props.removeReaction}\n emojiMap={this.props.emojiMap}\n />\n\n {unread && <span className='announcements__item__unread' />}\n </div>\n );\n }\n\n}\n\nexport default @injectIntl\nclass Announcements extends ImmutablePureComponent {\n\n static propTypes = {\n announcements: ImmutablePropTypes.list,\n emojiMap: ImmutablePropTypes.map.isRequired,\n dismissAnnouncement: PropTypes.func.isRequired,\n addReaction: PropTypes.func.isRequired,\n removeReaction: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n state = {\n index: 0,\n };\n\n static getDerivedStateFromProps(props, state) {\n if (props.announcements.size > 0 && state.index >= props.announcements.size) {\n return { index: props.announcements.size - 1 };\n } else {\n return null;\n }\n }\n\n componentDidMount () {\n this._markAnnouncementAsRead();\n }\n\n componentDidUpdate () {\n this._markAnnouncementAsRead();\n }\n\n _markAnnouncementAsRead () {\n const { dismissAnnouncement, announcements } = this.props;\n const { index } = this.state;\n const announcement = announcements.get(index);\n if (!announcement.get('read')) dismissAnnouncement(announcement.get('id'));\n }\n\n handleChangeIndex = index => {\n this.setState({ index: index % this.props.announcements.size });\n }\n\n handleNextClick = () => {\n this.setState({ index: (this.state.index + 1) % this.props.announcements.size });\n }\n\n handlePrevClick = () => {\n this.setState({ index: (this.props.announcements.size + this.state.index - 1) % this.props.announcements.size });\n }\n\n render () {\n const { announcements, intl } = this.props;\n const { index } = this.state;\n\n if (announcements.isEmpty()) {\n return null;\n }\n\n return (\n <div className='announcements'>\n mascot && ( <img className='announcements__mastodon' alt='' draggable='false' src={mascot} /> )\n\n <div className='announcements__container'>\n <ReactSwipeableViews animateHeight={!reduceMotion} adjustHeight={reduceMotion} index={index} onChangeIndex={this.handleChangeIndex}>\n {announcements.map((announcement, idx) => (\n <Announcement\n key={announcement.get('id')}\n announcement={announcement}\n emojiMap={this.props.emojiMap}\n addReaction={this.props.addReaction}\n removeReaction={this.props.removeReaction}\n intl={intl}\n selected={index === idx}\n />\n ))}\n </ReactSwipeableViews>\n\n {announcements.size > 1 && (\n <div className='announcements__pagination'>\n <IconButton disabled={announcements.size === 1} title={intl.formatMessage(messages.previous)} icon='chevron-left' onClick={this.handlePrevClick} size={13} />\n <span>{index + 1} / {announcements.size}</span>\n <IconButton disabled={announcements.size === 1} title={intl.formatMessage(messages.next)} icon='chevron-right' onClick={this.handleNextClick} size={13} />\n </div>\n )}\n </div>\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport Icon from 'mastodon/components/icon';\n\nconst formatNumber = num => num > 40 ? '40+' : num;\n\nconst IconWithBadge = ({ id, count, className }) => (\n <i className='icon-with-badge'>\n <Icon id={id} fixedWidth className={className} />\n {count > 0 && <i className='icon-with-badge__badge'>{formatNumber(count)}</i>}\n </i>\n);\n\nIconWithBadge.propTypes = {\n id: PropTypes.string.isRequired,\n count: PropTypes.number.isRequired,\n className: PropTypes.string,\n};\n\nexport default IconWithBadge;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { injectIntl, FormattedMessage } from 'react-intl';\nimport SettingToggle from '../../notifications/components/setting_toggle';\n\nexport default @injectIntl\nclass ColumnSettings extends React.PureComponent {\n\n static propTypes = {\n settings: ImmutablePropTypes.map.isRequired,\n onChange: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n render () {\n const { settings, onChange } = this.props;\n\n return (\n <div>\n <span className='column-settings__section'><FormattedMessage id='home.column_settings.basic' defaultMessage='Basic' /></span>\n\n <div className='column-settings__row'>\n <SettingToggle prefix='home_timeline' settings={settings} settingPath={['shows', 'reblog']} onChange={onChange} label={<FormattedMessage id='home.column_settings.show_reblogs' defaultMessage='Show boosts' />} />\n </div>\n\n <div className='column-settings__row'>\n <SettingToggle prefix='home_timeline' settings={settings} settingPath={['shows', 'reply']} onChange={onChange} label={<FormattedMessage id='home.column_settings.show_replies' defaultMessage='Show replies' />} />\n </div>\n </div>\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport ColumnSettings from '../components/column_settings';\nimport { changeSetting, saveSettings } from '../../../actions/settings';\n\nconst mapStateToProps = state => ({\n settings: state.getIn(['settings', 'home']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n\n onChange (key, checked) {\n dispatch(changeSetting(['home', ...key], checked));\n },\n\n onSave () {\n dispatch(saveSettings());\n },\n\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);\n","import { connect } from 'react-redux';\nimport { addReaction, removeReaction, dismissAnnouncement } from 'mastodon/actions/announcements';\nimport Announcements from '../components/announcements';\nimport { createSelector } from 'reselect';\nimport { Map as ImmutableMap } from 'immutable';\n\nconst customEmojiMap = createSelector([state => state.get('custom_emojis')], items => items.reduce((map, emoji) => map.set(emoji.get('shortcode'), emoji), ImmutableMap()));\n\nconst mapStateToProps = state => ({\n announcements: state.getIn(['announcements', 'items']),\n emojiMap: customEmojiMap(state),\n});\n\nconst mapDispatchToProps = dispatch => ({\n dismissAnnouncement: id => dispatch(dismissAnnouncement(id)),\n addReaction: (id, name) => dispatch(addReaction(id, name)),\n removeReaction: (id, name) => dispatch(removeReaction(id, name)),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Announcements);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { expandHomeTimeline } from '../../actions/timelines';\nimport PropTypes from 'prop-types';\nimport StatusListContainer from '../ui/containers/status_list_container';\nimport Column from '../../components/column';\nimport ColumnHeader from '../../components/column_header';\nimport { addColumn, removeColumn, moveColumn } from '../../actions/columns';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport ColumnSettingsContainer from './containers/column_settings_container';\nimport { Link } from 'react-router-dom';\nimport { fetchAnnouncements, toggleShowAnnouncements } from 'mastodon/actions/announcements';\nimport AnnouncementsContainer from 'mastodon/features/getting_started/containers/announcements_container';\nimport classNames from 'classnames';\nimport IconWithBadge from 'mastodon/components/icon_with_badge';\n\nconst messages = defineMessages({\n title: { id: 'column.home', defaultMessage: 'Home' },\n show_announcements: { id: 'home.show_announcements', defaultMessage: 'Show announcements' },\n hide_announcements: { id: 'home.hide_announcements', defaultMessage: 'Hide announcements' },\n});\n\nconst mapStateToProps = state => ({\n hasUnread: state.getIn(['timelines', 'home', 'unread']) > 0,\n isPartial: state.getIn(['timelines', 'home', 'isPartial']),\n hasAnnouncements: !state.getIn(['announcements', 'items']).isEmpty(),\n unreadAnnouncements: state.getIn(['announcements', 'items']).count(item => !item.get('read')),\n showAnnouncements: state.getIn(['announcements', 'show']),\n});\n\nexport default @connect(mapStateToProps)\n@injectIntl\nclass HomeTimeline extends React.PureComponent {\n\n static propTypes = {\n dispatch: PropTypes.func.isRequired,\n shouldUpdateScroll: PropTypes.func,\n intl: PropTypes.object.isRequired,\n hasUnread: PropTypes.bool,\n isPartial: PropTypes.bool,\n columnId: PropTypes.string,\n multiColumn: PropTypes.bool,\n hasAnnouncements: PropTypes.bool,\n unreadAnnouncements: PropTypes.number,\n showAnnouncements: PropTypes.bool,\n };\n\n handlePin = () => {\n const { columnId, dispatch } = this.props;\n\n if (columnId) {\n dispatch(removeColumn(columnId));\n } else {\n dispatch(addColumn('HOME', {}));\n }\n }\n\n handleMove = (dir) => {\n const { columnId, dispatch } = this.props;\n dispatch(moveColumn(columnId, dir));\n }\n\n handleHeaderClick = () => {\n this.column.scrollTop();\n }\n\n setRef = c => {\n this.column = c;\n }\n\n handleLoadMore = maxId => {\n this.props.dispatch(expandHomeTimeline({ maxId }));\n }\n\n componentDidMount () {\n this.props.dispatch(fetchAnnouncements());\n this._checkIfReloadNeeded(false, this.props.isPartial);\n }\n\n componentDidUpdate (prevProps) {\n this._checkIfReloadNeeded(prevProps.isPartial, this.props.isPartial);\n }\n\n componentWillUnmount () {\n this._stopPolling();\n }\n\n _checkIfReloadNeeded (wasPartial, isPartial) {\n const { dispatch } = this.props;\n\n if (wasPartial === isPartial) {\n return;\n } else if (!wasPartial && isPartial) {\n this.polling = setInterval(() => {\n dispatch(expandHomeTimeline());\n }, 3000);\n } else if (wasPartial && !isPartial) {\n this._stopPolling();\n }\n }\n\n _stopPolling () {\n if (this.polling) {\n clearInterval(this.polling);\n this.polling = null;\n }\n }\n\n handleToggleAnnouncementsClick = (e) => {\n e.stopPropagation();\n this.props.dispatch(toggleShowAnnouncements());\n }\n\n render () {\n const { intl, shouldUpdateScroll, hasUnread, columnId, multiColumn, hasAnnouncements, unreadAnnouncements, showAnnouncements } = this.props;\n const pinned = !!columnId;\n\n let announcementsButton = null;\n\n if (hasAnnouncements) {\n announcementsButton = (\n <button\n className={classNames('column-header__button', { 'active': showAnnouncements })}\n title={intl.formatMessage(showAnnouncements ? messages.hide_announcements : messages.show_announcements)}\n aria-label={intl.formatMessage(showAnnouncements ? messages.hide_announcements : messages.show_announcements)}\n aria-pressed={showAnnouncements ? 'true' : 'false'}\n onClick={this.handleToggleAnnouncementsClick}\n >\n <IconWithBadge id='bullhorn' count={unreadAnnouncements} />\n </button>\n );\n }\n\n return (\n <Column bindToDocument={!multiColumn} ref={this.setRef} label={intl.formatMessage(messages.title)}>\n <ColumnHeader\n icon='home'\n active={hasUnread}\n title={intl.formatMessage(messages.title)}\n onPin={this.handlePin}\n onMove={this.handleMove}\n onClick={this.handleHeaderClick}\n pinned={pinned}\n multiColumn={multiColumn}\n extraButton={announcementsButton}\n appendContent={hasAnnouncements && showAnnouncements && <AnnouncementsContainer />}\n >\n <ColumnSettingsContainer />\n </ColumnHeader>\n\n <StatusListContainer\n trackScroll={!pinned}\n scrollKey={`home_timeline-${columnId}`}\n onLoadMore={this.handleLoadMore}\n timelineId='home'\n emptyMessage={<FormattedMessage id='empty_column.home' defaultMessage='Your home timeline is empty! Visit {public} or use search to get started and meet other users.' values={{ public: <Link to='/timelines/public'><FormattedMessage id='empty_column.home.public_timeline' defaultMessage='the public timeline' /></Link> }} />}\n shouldUpdateScroll={shouldUpdateScroll}\n bindToDocument={!multiColumn}\n />\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""}