diff --git a/app/components/post_header/index.js b/app/components/post_header/index.js index 316355606..e98127013 100644 --- a/app/components/post_header/index.js +++ b/app/components/post_header/index.js @@ -28,7 +28,7 @@ function makeMapStateToProps() { const teammateNameDisplay = getTeammateNameDisplaySetting(state); const militaryTime = getBool(state, Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time'); const enableTimezone = isTimezoneEnabled(state); - const userTimezone = enableTimezone && getUserCurrentTimezone(currentUser.timezone); + const userTimezone = enableTimezone ? getUserCurrentTimezone(currentUser.timezone) : ''; return { commentedOnDisplayName: ownProps.commentedOnUserId ? displayUsername(commentedOnUser, teammateNameDisplay) : '', diff --git a/app/components/sidebars/main/main_sidebar.js b/app/components/sidebars/main/main_sidebar.js index 8abb74914..48ecc89ed 100644 --- a/app/components/sidebars/main/main_sidebar.js +++ b/app/components/sidebars/main/main_sidebar.js @@ -63,6 +63,7 @@ export default class ChannelSidebar extends Component { this.state = { show: false, + lockMode: 'unlocked', openDrawerOffset, }; } @@ -101,7 +102,7 @@ export default class ChannelSidebar extends Component { return nextProps.currentTeamId !== currentTeamId || nextProps.isLandscape !== isLandscape || - nextProps.teamsCount !== teamsCount; + nextProps.teamsCount !== teamsCount || this.state.lockMode !== nextState.lockMode; } componentWillUnmount() { @@ -230,6 +231,11 @@ export default class ChannelSidebar extends Component { onPageSelected = (index) => { this.swiperIndex = index; + if (this.swiperIndex === 0) { + this.setState({lockMode: 'locked-open'}); + } else { + this.setState({lockMode: 'unlocked'}); + } }; onSearchEnds = () => { @@ -338,10 +344,11 @@ export default class ChannelSidebar extends Component { render() { const {children, deviceWidth} = this.props; - const {openDrawerOffset} = this.state; + const {lockMode, openDrawerOffset} = this.state; return ( true, - onStartShouldSetPanResponderCapture: () => true, - onMoveShouldSetPanResponder: () => true, - onMoveShouldSetPanResponderCapture: () => true, - }); - } - componentWillReceiveProps(nextProps) { if (this.props.width !== nextProps.width) { this.scrollByWidth(nextProps.width); @@ -89,7 +78,6 @@ export default class Swiper extends PureComponent { }; onScrollBegin = () => { - this.isScrolling = true; this.props.onScrollBegin(); }; @@ -99,19 +87,13 @@ export default class Swiper extends PureComponent { e.nativeEvent.contentOffset = {x: e.nativeEvent.position * this.props.width}; } - this.isScrolling = false; - // get the index this.updateIndex(e.nativeEvent.contentOffset.x); }; onPageScrollStateChanged = (e) => { switch (e) { - case 'idle': - this.isScrolling = false; - break; case 'dragging': - this.isScrolling = true; this.props.onScrollBegin(); break; } @@ -152,7 +134,6 @@ export default class Swiper extends PureComponent { if (Platform.OS === 'ios') { return ( { - if (this.isScrolling || this.state.total < 2) { + if (this.state.total < 2) { return; }