From 1b8e93d4f2daf217762f9c476a0dc553fdd49760 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 14 Feb 2017 12:56:29 +0000 Subject: [PATCH] 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. --- src/components/structures/MatrixChat.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 87cd2645db..a467771a58 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -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}`); }