mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 00:43:15 +00:00
68af65a2a6
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.
20 lines
558 B
TypeScript
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 [];
|
|
}
|
|
},
|
|
};
|