feat(waiter): keep the menu's photos for offline (platform-v2 step 5.2)

Right after the menu is read the phone downloads its photos (4 at a time,
services/photoCache.js). The library's year-long immutable headers keep them
in the browser cache; the installed PWA also caches /api/media/file/ cache-
first (workbox `xenia-media`). With no connection the menu still shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 15:57:51 +02:00
co-authored by Claude Opus 5.5
parent e09056a7a4
commit 15bd0f5b57
4 changed files with 45 additions and 1 deletions
+2
View File
@@ -2,6 +2,7 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'
import { useEffect, useState } from 'react'
import client from '../api/client'
import db from '../db/posdb'
import { warmPhotos } from '../services/photoCache'
export const PRODUCTS_KEY = ['products']
@@ -15,6 +16,7 @@ async function fetchAndCacheProducts() {
db.products.bulkPut(products).catch(() => {})
db.categories.bulkPut(categories).catch(() => {})
warmPhotos(products, categories) // kept for offline (5.2)
return { products, categories }
}