1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-06 09:20:43 +01:00

Convert sets to arrays before saving to storage (#1012)

This commit is contained in:
Thomas Rittson 2021-06-04 09:38:36 +10:00 committed by GitHub
parent a554c0e660
commit c0f85366bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,10 @@ export class HtmlStorageService implements StorageService {
return this.remove(key); return this.remove(key);
} }
if (obj instanceof Set) {
obj = Array.from(obj);
}
const json = JSON.stringify(obj); const json = JSON.stringify(obj);
if (this.isLocalStorage(key)) { if (this.isLocalStorage(key)) {
window.localStorage.setItem(key, json); window.localStorage.setItem(key, json);