jevstrudel.git / website / src / jev / press.mjs

A 🔥 or 😴 for the section playing: the booth's buttons (JevBooth.jsx) and the MCP's react (tabTools.mjs) press the same. Jev hears it before its next choice (party.mjs's react: the room's count in a party, else the booth's own), and every listener's tally counts it for the song as written only (reactions.mjs), so an edited song or an AI's code is heard by Jev in this play but not counted for the song.

7import { nowPlaying, readSongs } from './client.mjs';
8import { react } from './party.mjs';
9import { sectionOf, sendReaction } from './reactions.mjs';
11export function pressReaction(booth, segment, kind, editor) {
12  react(booth, segment, kind);
13  const song = readSongs().find((s) => s.id === nowPlaying.get());
14  const section = sectionOf(booth, segment);
15  const counted = Boolean(song && editor?.code === song.code && section);
16  if (counted) sendReaction({ song: song.id, section, reaction: kind });
17  return { section, counted };
18}