Merge pull request #150 from mattermost/mm-895
MM-895 Reorganization of browser storage.
Этот коммит содержится в:
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
var BrowserStore = require('../stores/browser_store.jsx');
|
||||
|
||||
module.exports.track = function(category, action, label, prop, val) {
|
||||
global.window.snowplow('trackStructEvent', category, action, label, prop, val);
|
||||
@@ -204,7 +205,7 @@ module.exports.resetPassword = function(data, success, error) {
|
||||
|
||||
module.exports.logout = function() {
|
||||
module.exports.track('api', 'api_users_logout');
|
||||
sessionStorage.clear();
|
||||
BrowserStore.clear();
|
||||
window.location.href = "/logout";
|
||||
};
|
||||
|
||||
|
||||
@@ -97,20 +97,6 @@ module.exports.getCookie = function(name) {
|
||||
if (parts.length == 2) return parts.pop().split(";").shift();
|
||||
}
|
||||
|
||||
module.exports.isLocalStorageSupported = function() {
|
||||
try {
|
||||
sessionStorage.setItem("testSession", '1');
|
||||
sessionStorage.removeItem("testSession");
|
||||
|
||||
localStorage.setItem("testLocal", '1');
|
||||
localStorage.removeItem("testLocal", '1');
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.notifyMe = function(title, body, channel) {
|
||||
if ("Notification" in window && Notification.permission !== 'denied') {
|
||||
|
||||
Ссылка в новой задаче
Block a user