From e5327621d4e5b9bb99314e412dedc9bde99f9378 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Mon, 21 Aug 2023 10:43:16 -0700 Subject: [PATCH] Sync kiosk changes --- kiosk/src/Components/AddingGame.tsx | 2 +- kiosk/src/Components/GameList.tsx | 2 +- kiosk/src/Components/GameSlide.tsx | 3 +++ kiosk/src/Models/Kiosk.ts | 7 +++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/kiosk/src/Components/AddingGame.tsx b/kiosk/src/Components/AddingGame.tsx index 5b89598751a9..6edab24eca3d 100644 --- a/kiosk/src/Components/AddingGame.tsx +++ b/kiosk/src/Components/AddingGame.tsx @@ -32,7 +32,7 @@ const AddingGame: React.FC = ({ kiosk }) => { return parseInt(kioskCodeTime); } else if (kiosk.time) { const kioskTime = parseInt(kiosk.time); - return (kioskTime > 240 ? 240 : kioskTime) * 60; + return Math.min(240, Math.max(kioskTime, 0.5)) * 60; } else { return 30; } diff --git a/kiosk/src/Components/GameList.tsx b/kiosk/src/Components/GameList.tsx index f4b28f701408..48a1a5c7f04f 100644 --- a/kiosk/src/Components/GameList.tsx +++ b/kiosk/src/Components/GameList.tsx @@ -158,7 +158,7 @@ const GameList: React.FC = ({ kiosk, addButtonSelected, deleteButtonSele return ( + deleteButtonSelected={deleteButtonSelected} game={game} locked={kiosk.locked}/> ) })} diff --git a/kiosk/src/Components/GameSlide.tsx b/kiosk/src/Components/GameSlide.tsx index 38c64d42308e..167570e6fdaa 100644 --- a/kiosk/src/Components/GameSlide.tsx +++ b/kiosk/src/Components/GameSlide.tsx @@ -9,12 +9,14 @@ interface IProps { addButtonSelected: boolean; deleteButtonSelected: boolean; game: GameData; + locked: boolean; } const GameSlide: React.FC = ( { highScores, addButtonSelected, deleteButtonSelected, game, + locked }) => { const buttonSelected = addButtonSelected || deleteButtonSelected; const carouselSelected = buttonSelected ? "unselected" : "selected"; @@ -38,6 +40,7 @@ const GameSlide: React.FC = ( } { game.userAdded && + !locked && } diff --git a/kiosk/src/Models/Kiosk.ts b/kiosk/src/Models/Kiosk.ts index 1bc8617dc72d..216ccd58d1bb 100644 --- a/kiosk/src/Models/Kiosk.ts +++ b/kiosk/src/Models/Kiosk.ts @@ -134,8 +134,11 @@ export class Kiosk { const addedGames = this.getAllAddedGames(); const addedGamesObjs: GameData[] = Object.values(addedGames); for (const game of addedGamesObjs) { - if (!game?.deleted) { - this.games.push(game); + if (game) { + game.userAdded = true; + if (!game.deleted) { + this.games.push(game); + } } } }