Merge pull request #2568 from mattermost/fix-sidebar-link

Fixing some warnings.
Этот коммит содержится в:
Harrison Healey
2016-03-30 09:34:35 -04:00
родитель 22b24798af 51ebd65aec
Коммит 52cef6bc41
3 изменённых файлов: 7 добавлений и 11 удалений

Просмотреть файл

@@ -440,9 +440,9 @@ export default class Sidebar extends React.Component {
let link = ''; let link = '';
if (channel.fake) { 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 { } else {
link = TeamStore.getCurrentTeamUrl() + '/channels/' + channel.name; link = '/' + this.state.currentTeam.name + '/channels/' + channel.name;
} }
return ( return (

Просмотреть файл

@@ -8,7 +8,7 @@ function getPrefix() {
return global.window.mm_current_user_id + '_'; 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_'; return 'unknown_';
} }
@@ -144,18 +144,14 @@ class BrowserStoreClass {
* Signature for action is action(key, value) * Signature for action is action(key, value)
*/ */
actionOnGlobalItemsWithPrefix(prefix, action) { actionOnGlobalItemsWithPrefix(prefix, action) {
var globalPrefix = getPrefix();
var globalPrefixiLen = globalPrefix.length;
var storage = sessionStorage; var storage = sessionStorage;
if (this.isLocalStorageSupported()) { if (this.isLocalStorageSupported()) {
storage = localStorage; storage = localStorage;
} }
for (var key in storage) { for (var key in storage) {
if (key.lastIndexOf(globalPrefix + prefix, 0) === 0) { if (key.lastIndexOf(prefix, 0) === 0) {
var userkey = key.substring(globalPrefixiLen); action(key, this.getGlobalItem(key));
action(userkey, this.getGlobalItem(key));
} }
} }
} }

Просмотреть файл

@@ -495,7 +495,7 @@ class PostStoreClass extends EventEmitter {
BrowserStore.actionOnGlobalItemsWithPrefix('draft_', (key, value) => { BrowserStore.actionOnGlobalItemsWithPrefix('draft_', (key, value) => {
if (value) { if (value) {
value.uploadsInProgress = []; value.uploadsInProgress = [];
BrowserStore.setItem(key, value); BrowserStore.setGlobalItem(key, value);
} }
}); });
} }
@@ -503,7 +503,7 @@ class PostStoreClass extends EventEmitter {
BrowserStore.actionOnGlobalItemsWithPrefix('comment_draft_', (key, value) => { BrowserStore.actionOnGlobalItemsWithPrefix('comment_draft_', (key, value) => {
if (value) { if (value) {
value.uploadsInProgress = []; value.uploadsInProgress = [];
BrowserStore.setItem(key, value); BrowserStore.setGlobalItem(key, value);
} }
}); });
} }