diff options
-rw-r--r-- | web/react/components/create_comment.jsx | 6 | ||||
-rw-r--r-- | web/react/components/delete_channel_modal.jsx | 3 | ||||
-rw-r--r-- | web/react/components/navbar.jsx | 2 | ||||
-rw-r--r-- | web/react/components/post_list.jsx | 16 | ||||
-rw-r--r-- | web/react/components/team_signup_with_sso.jsx | 2 | ||||
-rw-r--r-- | web/react/utils/utils.jsx | 3 |
6 files changed, 20 insertions, 12 deletions
diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx index 99f553c0c..5097b3aa5 100644 --- a/web/react/components/create_comment.jsx +++ b/web/react/components/create_comment.jsx @@ -43,6 +43,12 @@ export default class CreateComment extends React.Component { submitting: false }; } + componentDidUpdate(prevProps, prevState) { + if (prevState.uploadsInProgress < this.state.uploadsInProgress) { + $('.post-right__scroll').scrollTop($('.post-right__scroll')[0].scrollHeight); + $('.post-right__scroll').perfectScrollbar('update'); + } + } handleSubmit(e) { e.preventDefault(); diff --git a/web/react/components/delete_channel_modal.jsx b/web/react/components/delete_channel_modal.jsx index 4efb9cb23..44c54db72 100644 --- a/web/react/components/delete_channel_modal.jsx +++ b/web/react/components/delete_channel_modal.jsx @@ -4,6 +4,7 @@ const Client = require('../utils/client.jsx'); const AsyncClient = require('../utils/async_client.jsx'); const ChannelStore = require('../stores/channel_store.jsx'); +var TeamStore = require('../stores/team_store.jsx'); export default class DeleteChannelModal extends React.Component { constructor(props) { @@ -24,7 +25,7 @@ export default class DeleteChannelModal extends React.Component { Client.deleteChannel(this.state.channelId, function handleDeleteSuccess() { AsyncClient.getChannels(true); - window.location.href = '/'; + window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/town-square'; }, function handleDeleteError(err) { AsyncClient.dispatchError(err, 'handleDelete'); diff --git a/web/react/components/navbar.jsx b/web/react/components/navbar.jsx index da9874b0b..bdb50cd9e 100644 --- a/web/react/components/navbar.jsx +++ b/web/react/components/navbar.jsx @@ -262,7 +262,7 @@ export default class Navbar extends React.Component { return ( <div className='navbar-brand'> <a - href='/' + href={TeamStore.getCurrentTeamUrl() + '/channels/town-square'} className='heading' > {channelTitle} diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index 218922b67..3e1e075bb 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -105,18 +105,18 @@ export default class PostList extends React.Component { UserStore.addStatusesChangeListener(this.onTimeChange); SocketStore.addChangeListener(this.onSocketChange); - var postHolder = $(React.findDOMNode(this.refs.postlist)); + const postHolder = $(React.findDOMNode(this.refs.postlist)); - $(window).on('resize.' + this.props.channelId, function resize() { + $(window).resize(() => { this.resize(); if (!this.scrolled) { this.scrollToBottom(); } - }.bind(this)); + }); - postHolder.on('scroll', function scroll() { - var position = postHolder.scrollTop() + postHolder.height() + 14; - var bottom = postHolder[0].scrollHeight; + postHolder.on('scroll', () => { + const position = postHolder.scrollTop() + postHolder.height() + 14; + const bottom = postHolder[0].scrollHeight; if (position >= bottom) { this.scrolled = false; @@ -128,7 +128,7 @@ export default class PostList extends React.Component { this.userHasSeenNew = true; } this.isUserScroll = true; - }.bind(this)); + }); $('.post-list__content div .post').removeClass('post--last'); $('.post-list__content div:last-child .post').addClass('post--last'); @@ -146,7 +146,7 @@ export default class PostList extends React.Component { UserStore.removeStatusesChangeListener(this.onTimeChange); SocketStore.removeChangeListener(this.onSocketChange); $('body').off('click.userpopover'); - $(window).off('resize.' + this.props.channelId); + $(window).off('resize'); var postHolder = $(React.findDOMNode(this.refs.postlist)); postHolder.off('scroll'); } diff --git a/web/react/components/team_signup_with_sso.jsx b/web/react/components/team_signup_with_sso.jsx index 2849b4cbb..a4972dd8d 100644 --- a/web/react/components/team_signup_with_sso.jsx +++ b/web/react/components/team_signup_with_sso.jsx @@ -42,7 +42,7 @@ export default class SSOSignUpPage extends React.Component { if (data.follow_link) { window.location.href = data.follow_link; } else { - window.location.href = '/'; + window.location.href = '/' + team.name + '/channels/town-square'; } }, function fail(err) { diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index d45240f9a..c330296b2 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -4,6 +4,7 @@ var AppDispatcher = require('../dispatcher/app_dispatcher.jsx'); var ChannelStore = require('../stores/channel_store.jsx'); var UserStore = require('../stores/user_store.jsx'); +var TeamStore = require('../stores/team_store.jsx'); var Constants = require('../utils/constants.jsx'); var ActionTypes = Constants.ActionTypes; var AsyncClient = require('./async_client.jsx'); @@ -113,7 +114,7 @@ export function notifyMe(title, body, channel) { if (channel) { switchChannel(channel); } else { - window.location.href = '/'; + window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/town-square'; } }; setTimeout(function closeNotificationOnTimeout() { |