summaryrefslogtreecommitdiffstats
path: root/webapp/stores/browser_store.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-03-29 18:04:41 -0400
committerChristopher Speller <crspeller@gmail.com>2016-03-29 18:09:31 -0400
commit51ebd65aec3c2cf85009b7c75d4e4cd53af37462 (patch)
tree6d04fe117d2c85184b14f4ca1f7d962ef1cad98b /webapp/stores/browser_store.jsx
parent97deda72f0bf1d57420996bf24235085abae7839 (diff)
downloadchat-51ebd65aec3c2cf85009b7c75d4e4cd53af37462.tar.gz
chat-51ebd65aec3c2cf85009b7c75d4e4cd53af37462.tar.bz2
chat-51ebd65aec3c2cf85009b7c75d4e4cd53af37462.zip
Fixing warning with drafts.
Diffstat (limited to 'webapp/stores/browser_store.jsx')
-rw-r--r--webapp/stores/browser_store.jsx10
1 files changed, 3 insertions, 7 deletions
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));
}
}
}