summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-03-30 09:34:35 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-03-30 09:34:35 -0400
commit52cef6bc41d39a1eef1cc9f26ef46262c31cd66a (patch)
treec0573413a8733ebf6b1f69160695074af5ef038e /webapp
parent22b24798afbb34847ab4217c2967d02e1b39608b (diff)
parent51ebd65aec3c2cf85009b7c75d4e4cd53af37462 (diff)
downloadchat-52cef6bc41d39a1eef1cc9f26ef46262c31cd66a.tar.gz
chat-52cef6bc41d39a1eef1cc9f26ef46262c31cd66a.tar.bz2
chat-52cef6bc41d39a1eef1cc9f26ef46262c31cd66a.zip
Merge pull request #2568 from mattermost/fix-sidebar-link
Fixing some warnings.
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/sidebar.jsx4
-rw-r--r--webapp/stores/browser_store.jsx10
-rw-r--r--webapp/stores/post_store.jsx4
3 files changed, 7 insertions, 11 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx
index bf51fa102..45bca7212 100644
--- a/webapp/components/sidebar.jsx
+++ b/webapp/components/sidebar.jsx
@@ -440,9 +440,9 @@ export default class Sidebar extends React.Component {
let link = '';
if (channel.fake) {
- link = TeamStore.getCurrentTeamUrl() + '/channels/' + channel.name + '?fakechannel=' + encodeURIComponent(JSON.stringify(channel));
+ link = '/' + this.state.currentTeam.name + '/channels/' + channel.name + '?fakechannel=' + encodeURIComponent(JSON.stringify(channel));
} else {
- link = TeamStore.getCurrentTeamUrl() + '/channels/' + channel.name;
+ link = '/' + this.state.currentTeam.name + '/channels/' + channel.name;
}
return (
diff --git a/webapp/stores/browser_store.jsx b/webapp/stores/browser_store.jsx
index bba146e38..d605aac80 100644
--- a/webapp/stores/browser_store.jsx
+++ b/webapp/stores/browser_store.jsx
@@ -8,7 +8,7 @@ function getPrefix() {
return global.window.mm_current_user_id + '_';
}
- console.log('BrowserStore tried to operate without user present'); //eslint-disable-line no-console
+ console.warn('BrowserStore tried to operate without user present'); //eslint-disable-line no-console
return 'unknown_';
}
@@ -144,18 +144,14 @@ class BrowserStoreClass {
* Signature for action is action(key, value)
*/
actionOnGlobalItemsWithPrefix(prefix, action) {
- var globalPrefix = getPrefix();
- var globalPrefixiLen = globalPrefix.length;
-
var storage = sessionStorage;
if (this.isLocalStorageSupported()) {
storage = localStorage;
}
for (var key in storage) {
- if (key.lastIndexOf(globalPrefix + prefix, 0) === 0) {
- var userkey = key.substring(globalPrefixiLen);
- action(userkey, this.getGlobalItem(key));
+ if (key.lastIndexOf(prefix, 0) === 0) {
+ action(key, this.getGlobalItem(key));
}
}
}
diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx
index 757599b0f..36393f5cd 100644
--- a/webapp/stores/post_store.jsx
+++ b/webapp/stores/post_store.jsx
@@ -495,7 +495,7 @@ class PostStoreClass extends EventEmitter {
BrowserStore.actionOnGlobalItemsWithPrefix('draft_', (key, value) => {
if (value) {
value.uploadsInProgress = [];
- BrowserStore.setItem(key, value);
+ BrowserStore.setGlobalItem(key, value);
}
});
}
@@ -503,7 +503,7 @@ class PostStoreClass extends EventEmitter {
BrowserStore.actionOnGlobalItemsWithPrefix('comment_draft_', (key, value) => {
if (value) {
value.uploadsInProgress = [];
- BrowserStore.setItem(key, value);
+ BrowserStore.setGlobalItem(key, value);
}
});
}