summaryrefslogtreecommitdiffstats
path: root/webapp/components
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components')
-rw-r--r--webapp/components/header_footer_template.jsx29
-rw-r--r--webapp/components/notify_counts.jsx8
-rw-r--r--webapp/components/posts_view_container.jsx10
-rw-r--r--webapp/components/team_import_tab.jsx6
4 files changed, 34 insertions, 19 deletions
diff --git a/webapp/components/header_footer_template.jsx b/webapp/components/header_footer_template.jsx
index ce2f59541..76061d532 100644
--- a/webapp/components/header_footer_template.jsx
+++ b/webapp/components/header_footer_template.jsx
@@ -5,7 +5,6 @@ import $ from 'jquery';
import {FormattedMessage} from 'react-intl';
import React from 'react';
-import {Link} from 'react-router';
export default class NotLoggedIn extends React.Component {
componentDidMount() {
@@ -30,34 +29,38 @@ export default class NotLoggedIn extends React.Component {
</div>
<div className='col-xs-12'>
<span className='pull-right footer-link copyright'>{'© 2015 Mattermost, Inc.'}</span>
- <Link
+ <a
id='help_link'
className='pull-right footer-link'
- to={global.window.mm_config.HelpLink}
+ target='_blank'
+ href={global.window.mm_config.HelpLink}
>
<FormattedMessage id='web.footer.help'/>
- </Link>
- <Link
+ </a>
+ <a
id='terms_link'
className='pull-right footer-link'
- to={global.window.mm_config.TermsOfServiceLink}
+ target='_blank'
+ href={global.window.mm_config.TermsOfServiceLink}
>
<FormattedMessage id='web.footer.terms'/>
- </Link>
- <Link
+ </a>
+ <a
id='privacy_link'
className='pull-right footer-link'
- to={global.window.mm_config.PrivacyPolicyLink}
+ target='_blank'
+ href={global.window.mm_config.PrivacyPolicyLink}
>
<FormattedMessage id='web.footer.privacy'/>
- </Link>
- <Link
+ </a>
+ <a
id='about_link'
className='pull-right footer-link'
- to={global.window.mm_config.AboutLink}
+ target='_blank'
+ href={global.window.mm_config.AboutLink}
>
<FormattedMessage id='web.footer.about'/>
- </Link>
+ </a>
</div>
</div>
</div>
diff --git a/webapp/components/notify_counts.jsx b/webapp/components/notify_counts.jsx
index 9238c8736..8f9eadab7 100644
--- a/webapp/components/notify_counts.jsx
+++ b/webapp/components/notify_counts.jsx
@@ -9,8 +9,12 @@ function getCountsStateFromStores() {
var channels = ChannelStore.getAll();
var members = ChannelStore.getAllMembers();
- channels.forEach(function setChannelInfo(channel) {
+ channels.forEach((channel) => {
var channelMember = members[channel.id];
+ if (channelMember == null) {
+ return;
+ }
+
if (channel.type === 'D') {
count += channel.total_msg_count - channelMember.msg_count;
} else if (channelMember.mention_count > 0) {
@@ -20,7 +24,7 @@ function getCountsStateFromStores() {
}
});
- return {count: count};
+ return {count};
}
import React from 'react';
diff --git a/webapp/components/posts_view_container.jsx b/webapp/components/posts_view_container.jsx
index a49c77f8d..edfa314f8 100644
--- a/webapp/components/posts_view_container.jsx
+++ b/webapp/components/posts_view_container.jsx
@@ -16,6 +16,8 @@ import {createChannelIntroMessage} from 'utils/channel_intro_messages.jsx';
import React from 'react';
+const MAXIMUM_CACHED_VIEWS = 3;
+
export default class PostsViewContainer extends React.Component {
constructor() {
super();
@@ -105,6 +107,12 @@ export default class PostsViewContainer extends React.Component {
let newIndex = channels.indexOf(channelId);
if (newIndex === -1) {
+ if (channels.length >= MAXIMUM_CACHED_VIEWS) {
+ channels.shift();
+ atTop.shift();
+ postLists.shift();
+ }
+
newIndex = channels.length;
channels.push(channelId);
atTop[newIndex] = PostStore.getVisibilityAtTop(channelId);
@@ -172,7 +180,7 @@ export default class PostsViewContainer extends React.Component {
const isActive = (channels[i] === currentChannelId);
postListCtls.push(
<PostsView
- key={'postsviewkey' + i}
+ key={'postsviewkey' + channels[i]}
isActive={isActive}
postList={postLists[i]}
scrollType={this.state.scrollType}
diff --git a/webapp/components/team_import_tab.jsx b/webapp/components/team_import_tab.jsx
index 03d35bb3f..782273c5a 100644
--- a/webapp/components/team_import_tab.jsx
+++ b/webapp/components/team_import_tab.jsx
@@ -33,8 +33,8 @@ class TeamImportTab extends React.Component {
this.setState({status: 'fail', link: ''});
}
- onImportSuccess(data) {
- this.setState({status: 'done', link: 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(data)});
+ onImportSuccess(data, res) {
+ this.setState({status: 'done', link: 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(res.text)});
}
doImportSlack(file) {
@@ -167,4 +167,4 @@ TeamImportTab.propTypes = {
intl: intlShape.isRequired
};
-export default injectIntl(TeamImportTab); \ No newline at end of file
+export default injectIntl(TeamImportTab);