element-web/src/vector/localstorage-fix.ts
Dariusz Niemczyk 0a87baf99d
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
2021-09-16 14:51:32 +02:00

12 lines
397 B
TypeScript

/**
* 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);
}
});
}