mirror of https://github.com/vector-im/riot-web
Clear local storage *before* creating the client, Otherwise we will blow away anything that the client tried to persist after it was created
parent
79e03597b3
commit
e1aca588b5
|
@ -76,10 +76,16 @@ module.exports = {
|
|||
},
|
||||
|
||||
replaceUsingAccessToken: function(hs_url, is_url, user_id, access_token) {
|
||||
createClient(hs_url, is_url, user_id, access_token);
|
||||
if (localStorage) {
|
||||
try {
|
||||
localStorage.clear();
|
||||
} catch (e) {
|
||||
console.warn("Error using local storage");
|
||||
}
|
||||
}
|
||||
createClient(hs_url, is_url, user_id, access_token);
|
||||
if (localStorage) {
|
||||
try {
|
||||
localStorage.setItem("mx_hs_url", hs_url);
|
||||
localStorage.setItem("mx_is_url", is_url);
|
||||
localStorage.setItem("mx_user_id", user_id);
|
||||
|
|
Loading…
Reference in New Issue