Remove accidentally persisted log-level data
This commit gets rid of log-level data in localStorage which in some extreme cases could fill up the entire localStorage making the app unusable Followup to https://github.com/matrix-org/matrix-js-sdk/pull/1880
This commit is contained in:
parent
1aa2efd2ce
commit
0a87baf99d
2 changed files with 13 additions and 0 deletions
12
src/vector/localstorage-fix.ts
Normal file
12
src/vector/localstorage-fix.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* Because we've been saving a lot of additional logger data in the localStorage for no particular reason
|
||||
* we need to, hopefully, unbrick user's devices by geting rid of unnecessary data.
|
||||
* */
|
||||
|
||||
if (window.localStorage) {
|
||||
Object.keys(window.localStorage).forEach(key => {
|
||||
if (key.indexOf('loglevel:') === 0) {
|
||||
window.localStorage.removeItem(key);
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue