mirror of
https://github.com/iconify/iconify.git
synced 2024-11-09 23:00:56 +00:00
Do not store empty icon sets in browser storage, remove not_found property
This commit is contained in:
parent
ded43ed8fc
commit
a76aafa447
@ -308,6 +308,17 @@ export const storeCache: CacheIcons = (
|
||||
return true;
|
||||
}
|
||||
|
||||
// Do not store empty sets
|
||||
if (!Object.keys(data.icons).length) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove not_found (clone object to keep old object intact)
|
||||
if (data.not_found) {
|
||||
data = Object.assign({}, data);
|
||||
delete data.not_found;
|
||||
}
|
||||
|
||||
// Attempt to store at localStorage first, then at sessionStorage
|
||||
if (!store('local')) {
|
||||
store('session');
|
||||
|
Loading…
Reference in New Issue
Block a user