mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04: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
@ -76,10 +76,16 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
replaceUsingAccessToken: function(hs_url, is_url, user_id, access_token) {
|
replaceUsingAccessToken: function(hs_url, is_url, user_id, access_token) {
|
||||||
createClient(hs_url, is_url, user_id, access_token);
|
|
||||||
if (localStorage) {
|
if (localStorage) {
|
||||||
try {
|
try {
|
||||||
localStorage.clear();
|
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_hs_url", hs_url);
|
||||||
localStorage.setItem("mx_is_url", is_url);
|
localStorage.setItem("mx_is_url", is_url);
|
||||||
localStorage.setItem("mx_user_id", user_id);
|
localStorage.setItem("mx_user_id", user_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user