mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-24 16:03:02 +00:00
feat(tours): tours read and write through the offline core
A tourRepo replaces the direct toursApi calls: reads fall back to a new Dexie tours table, and a tour saved or edited offline is written there and queued like a place, under one temporary id for the place and its facet. The queue moves both to the real id on replay and drops both when the server refuses the create. Trip sync caches each trip's tours while the addon is on, so a tour no longer reads as a plain place offline. The tour metrics move to shared so the offline copy shows the server's numbers, and useTourPlaceIds keeps one Set per change as intended.
This commit is contained in:
@@ -9,7 +9,7 @@ import ToursSidebar from '../Tours/ToursSidebar'
|
||||
import type { Day } from '../../types'
|
||||
import CustomSelect from './CustomSelect'
|
||||
|
||||
vi.mock('../../api/client', () => ({ toursApi: {} }))
|
||||
vi.mock('../../repo/tourRepo', () => ({ tourRepo: {} }))
|
||||
vi.mock('../../store/settingsStore', () => ({
|
||||
useSettingsStore: (selector: (state: { settings: { language: string; distance_unit: string } }) => unknown) =>
|
||||
selector({ settings: { language: 'en', distance_unit: 'metric' } }),
|
||||
|
||||
Reference in New Issue
Block a user