akkoma/priv/static/packs/features/home_timeline.js

2 lines
3.4 KiB
JavaScript
Raw Normal View History

2018-09-20 16:10:13 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{707:function(e,t,n){"use strict";n.r(t);var o,i,s=n(0),l=n.n(s),a=n(6),c=n.n(a),r=n(3),u=n.n(r),h=n(7),p=n.n(h),d=n(1),m=n.n(d),f=n(12),g=n(19),b=n(88),v=n(62),_=n(60),M=n(113),y=n(4),w=n(201),P=Object(y.g)(o=function(e){function t(){return c()(this,t),u()(this,e.apply(this,arguments))}return p()(t,e),t.prototype.render=function(){var e=this.props,t=e.settings,n=e.onChange;return l()("div",{},void 0,l()("span",{className:"column-settings__section"},void 0,l()(y.b,{id:"home.column_settings.basic",defaultMessage:"Basic"})),l()("div",{className:"column-settings__row"},void 0,l()(w.a,{prefix:"home_timeline",settings:t,settingPath:["shows","reblog"],onChange:n,label:l()(y.b,{id:"home.column_settings.show_reblogs",defaultMessage:"Show boosts"})})),l()("div",{className:"column-settings__row"},void 0,l()(w.a,{prefix:"home_timeline",settings:t,settingPath:["shows","reply"],onChange:n,label:l()(y.b,{id:"home.column_settings.show_replies",defaultMessage:"Show replies"})})))},t}(m.a.PureComponent))||o,I=n(33),O=Object(f.connect)(function(e){return{settings:e.getIn(["settings","home"])}},function(e){return{onChange:function(t,n){e(Object(I.c)(["home"].concat(t),n))},onSave:function(){e(Object(I.d)())}}})(P),j=n(810);n.d(t,"default",function(){return k});var C=Object(y.f)({title:{id:"column.home",defaultMessage:"Home"}}),k=Object(f.connect)(function(e){return{hasUnread:e.getIn(["timelines","home","unread"])>0,isPartial:null===e.getIn(["timelines","home","items",0],null)}})(i=Object(y.g)(i=function(e){function t(){var n,o,i;c()(this,t);for(var s=arguments.length,l=Array(s),a=0;a<s;a++)l[a]=arguments[a];return n=o=u()(this,e.call.apply(e,[this].concat(l))),o.handlePin=function(){var e=o.props,t=e.columnId,n=e.dispatch;n(t?Object(M.h)(t):Object(M.e)("HOME",{}))},o.handleMove=function(e){var t=o.props,n=t.columnId;(0,t.dispatch)(Object(M.g)(n,e))},o.handleHeaderClick=function(){o.column.scrollTop()},o.setRef=function(e){o.column=e},o.handleLoadMore=function(e){o.props.dispatch(Object(g.p)({maxId:e}))},i=n,u()(o,i)}return p()(t,e),t.prototype.componentDidMount=function(){this._checkIfReloadNeeded(!1,this.props.isPartial)},t.prototype.componentDidUpdate=function(e){this._checkIfReloadNeeded(e.isPartial,this.props.isPartial)},t.prototype.componentWillUnmount=function(){this._stopPolling()},t.prototype._checkIfReloadNeeded=function(e,t){var n=this.props.dispatch;e!==t&&(!e&&t?this.polling=setInterval(function(){n(Object(g.p)())},3e3):e&&!t&&this._stopPolling())},t.prototype._stopPolling=function(){this.polling&&(clearInterval(this.polling),this.polling=null)},t.prototype.render=function(){var e=this.props,t=e.intl,n=e.shouldUpdateScroll,o=e.hasUnread,i=e.columnId,s=e.multiColumn,a=!!i;return m.a.createElement(v.a,{ref:this.setRef,label:t.formatMessage(C.title)},l()(_.a,{icon:"home",active:o,title:t.formatMessage(C.title),onPin:this.handlePin,onMove:this.handleMove,onClick:this.handleHeaderClick,pinned:a,multiColumn:s},void 0,l()(O,{})),l()(b.a,{trackScroll:!a,scrollKey:"home_timeline-"+i,onLoadMore:this.handleLoadMore,timelineId:"home",emptyMessage:l()(y.b,{id:"empty_column.home",defaultMessage:"Your home timeline is empty! Visit {public} or use search to get started and meet other users.",values:{public:l()(j.a,{to:"/timelines/public"},void 0,l()(y.b,{id:"empty_column.home.public_timeline",defaultMessage:"the public timeline"}))}}),shouldUpdateScroll:n}))},t}(m.a.PureComponent))||i)||i}}]);
//# sourceMappingURL=home_timeline.js.map