Files
TREK/client/src/repo/atlasPluginLayersRepo.ts
T
Maurice 68af65a2a6 feat(atlas): read and write the Atlas offline
The Atlas reads go network first and fall back to a snapshot kept in a new
Dexie table (v17, append-only). Marks, unmarks and wishlist deletes made
offline wait in their own account-level queue, replayed in order with an
idempotency key, and every read lays them over the kept answer.
2026-11-28 22:35:11 +01:00

20 lines
558 B
TypeScript

import { pluginsApi, type PluginAtlasLayer } from '../api/client';
export type { PluginAtlasLayer };
/**
* The country tints plugins add to the Atlas (atlasLayerProvider hook). Online-only
* and fail-safe on purpose: a plugin overlay is decoration over the user's own map,
* so when it cannot be read the Atlas simply shows none.
*/
export const atlasPluginLayersRepo = {
async layers(): Promise<PluginAtlasLayer[]> {
try {
const r = await pluginsApi.atlasLayers();
return r.layers ?? [];
} catch {
return [];
}
},
};