@@ -49,6 +49,8 @@ export type GameState = {
4949 boardRoom ?: string ;
5050 /** Журнал пожертвований (строки); общий для всех раундов квиза. */
5151 donationLog : DonationLogEntry [ ] ;
52+ /** После ×2 с деда на 400 — скрыть таблицу на 3-й доске; сброс при входе на похороны (сервер). */
53+ hideDonationsTableOnBoard3 ?: boolean ;
5254} ;
5355
5456const DEFAULT_PLAYERS : Player [ ] = Array . from ( { length : 5 } , ( _ , i ) => ( {
@@ -83,6 +85,7 @@ const DEFAULT_CORE: Omit<GameState, "themes" | "questions"> = {
8385 dataVersion : undefined ,
8486 boardRoom : undefined ,
8587 donationLog : [ ...DEFAULT_DONATION_LOG ] ,
88+ hideDonationsTableOnBoard3 : false ,
8689} ;
8790
8891const PLAYERS_KEY = "adepts-shared-players" ;
@@ -377,6 +380,10 @@ function loadInitialState(boardId: AdeptsBoardId): GameState {
377380 typeof parsed . quizBoardHoverCell . questionIndex === "number"
378381 ? parsed . quizBoardHoverCell
379382 : null ,
383+ hideDonationsTableOnBoard3 :
384+ typeof parsed . hideDonationsTableOnBoard3 === "boolean"
385+ ? parsed . hideDonationsTableOnBoard3
386+ : false ,
380387 } ) ;
381388 }
382389 } catch ( err ) {
@@ -482,6 +489,7 @@ export function useGameState(boardId: AdeptsBoardId) {
482489 players : rec [ "players" ] ,
483490 currentTurnSeat : rec [ "currentTurnSeat" ] ,
484491 donationLog : rec [ "donationLog" ] ,
492+ hideDonationsTableOnBoard3 : rec [ "hideDonationsTableOnBoard3" ] ,
485493 // Reset all board-specific fields to safe defaults
486494 activeQuizCard : null ,
487495 quizBoardHoverCell : null ,
@@ -529,6 +537,10 @@ export function useGameState(boardId: AdeptsBoardId) {
529537 const incomingLog = normalizeDonationLog ( recToUse [ "donationLog" ] ) ;
530538 const nextDonationLog = incomingLog ?? prev . donationLog ;
531539
540+ const rawHide = recToUse [ "hideDonationsTableOnBoard3" ] ;
541+ const nextHideDonationsTableOnBoard3 =
542+ typeof rawHide === "boolean" ? rawHide : ( prev . hideDonationsTableOnBoard3 ?? false ) ;
543+
532544 let nextState = withClosedActiveQuizIfCellUsed (
533545 migrateCatalog ( boardId , {
534546 ...prev ,
@@ -544,6 +556,7 @@ export function useGameState(boardId: AdeptsBoardId) {
544556 quizBoardHoverCell : hoverFromRelay ,
545557 dataVersion :
546558 typeof recToUse [ "dataVersion" ] === "number" ? recToUse [ "dataVersion" ] : prev . dataVersion ,
559+ hideDonationsTableOnBoard3 : nextHideDonationsTableOnBoard3 ,
547560 } )
548561 ) ;
549562
0 commit comments