mirror of
https://github.com/element-hq/element-web
synced 2024-11-25 18:55:58 +03:00
Clear local storage *before* creating the client, Otherwise we will blow away anything that the client tried to persist after it was created
This commit is contained in:
parent
79e03597b3
commit
e1aca588b5
1 changed files with 7 additions and 1 deletions
|
@ -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 a new issue