/** * Client-side "ostatnio przeglądałem listę X", używane przez NEW badge w * MoviesScreen (i ewentualnie ScenesScreen w przyszłości). Per-list timestamp, * zapisywany do SecureStore (już mamy dependency, brak AsyncStorage installed). * * Pattern: useState(seenSince=null) → useEffect(load) → render NEW badge dla * items.created_at > seenSince. Update seenSince przy AppState 'background' → * następne otwarcie listy widzi tylko PRAWDZIWIE nowe. */ import * as SecureStore from 'expo-secure-store'; const KEY = (kind: string) => `goon.last_seen.${kind}`; export async function getLastSeen(kind: string): Promise { try { return await SecureStore.getItemAsync(KEY(kind)); } catch { return null; } } export async function markSeen(kind: string): Promise { try { await SecureStore.setItemAsync(KEY(kind), new Date().toISOString()); } catch { // SecureStore może failnąć na devicach bez keychain, ignoruj. } }