Browse Source

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

pull/1015/head
Thomas Rittson 5 years ago committed by GitHub
parent
commit
c0f85366bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/services/htmlStorage.service.ts

4
src/services/htmlStorage.service.ts

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

Loading…
Cancel
Save