Treat the literal team token string "undefined" as undefined

Some users appear to have gotten team tokens into their local storage. This fix will treat the literal string "undefined" as undefined.
pull/21833/head
Luke Barnard 2017-02-14 12:56:29 +00:00
parent 0e08646d01
commit 1b8e93d4f2
1 changed files with 6 additions and 0 deletions

View File

@ -217,6 +217,12 @@ module.exports = React.createClass({
window.localStorage.getItem('mx_team_token') ||
window.sessionStorage.getItem('mx_team_token');
// Some users have ended up with "undefined" as their local storage team token,
// treat that as undefined.
if (this._teamToken === "undefined") {
this._teamToken = undefined;
}
if (this._teamToken) {
console.info(`Team token set to ${this._teamToken}`);
}