()
| 890 | } |
| 891 | |
| 892 | export async function clearCache() { |
| 893 | const cacheObj = await api.storage.list(); |
| 894 | let deleted = 0; |
| 895 | |
| 896 | for (const key in cacheObj) { |
| 897 | if (!utils.syncRegex.test(key) && !/(^tagSettings\/.*)/.test(key)) { |
| 898 | api.storage.remove(key); |
| 899 | deleted++; |
| 900 | } |
| 901 | } |
| 902 | |
| 903 | utils.flashm(`Cache Cleared [${deleted}]`); |
| 904 | } |
| 905 | |
| 906 | export function sortAlphabetically(a, b) { |
| 907 | if (a.toLowerCase() < b.toLowerCase()) return -1; |