()
| 18 | ); |
| 19 | |
| 20 | const shouldUpdateCache = (): boolean => { |
| 21 | try { |
| 22 | const cachedData = sessionStorage.getItem(LocalStore.models); |
| 23 | if (!cachedData) return true; |
| 24 | const { lastUpdate } = JSON.parse(cachedData) as ModelsCache; |
| 25 | const now = Date.now(); |
| 26 | return now - lastUpdate > CACHE_DURATION; |
| 27 | } catch { |
| 28 | return true; |
| 29 | } |
| 30 | }; |
| 31 | |
| 32 | const getCachedModels = (): string[] => { |
| 33 | try { |