Ratatoskr/src/app/features/albums/zoneView.ts
Void dc1ea7af27
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m41s
Albums: event link beats an earlier albums choice; buildAlbums tolerates bad input
- zoneView: an eventId always shows the timeline; the back-to-albums button is hidden then.
- buildAlbums: null/non-object inputs and replies are skipped, non-numeric timestamps
  count as 0, an empty-body root is titled "Untitled album", m.replace events are never
  files or albums.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 23:16:09 +00:00

5 lines
298 B
TypeScript

export type ZoneView = 'albums' | 'timeline';
/** The view a file-zone room shows. A link to an event always wins; else the user's choice; else albums. */
export const zoneView = (choice: ZoneView | undefined, eventId: string | undefined): ZoneView =>
eventId ? 'timeline' : choice ?? 'albums';