()
| 221 | } |
| 222 | |
| 223 | export async function loadModCollection(): Promise<ModCollection | null> { |
| 224 | try { |
| 225 | const res = await fetch(MODS_API); |
| 226 | if (res.ok) { |
| 227 | const data = await res.json(); |
| 228 | if (data && data.activeId && data.items) { |
| 229 | localStorage.setItem(STORAGE_KEY, JSON.stringify(data)); |
| 230 | return data as ModCollection; |
| 231 | } |
| 232 | } |
| 233 | } catch { |
| 234 | // ignore |
| 235 | } |
| 236 | return null; |
| 237 | } |
| 238 | |
| 239 | export function loadModCollectionSync(): ModCollection | null { |
| 240 | try { |
no outgoing calls
no test coverage detected