Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync kiosk changes #9645

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kiosk/src/Components/AddingGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const AddingGame: React.FC<IProps> = ({ 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;
}
Expand Down
2 changes: 1 addition & 1 deletion kiosk/src/Components/GameList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const GameList: React.FC<IProps> = ({ kiosk, addButtonSelected, deleteButtonSele
return (
<SwiperSlide key={game.id}>
<GameSlide highScores={gameHighScores} addButtonSelected={addButtonSelected}
deleteButtonSelected={deleteButtonSelected} game={game} />
deleteButtonSelected={deleteButtonSelected} game={game} locked={kiosk.locked}/>
</SwiperSlide>
)
})}
Expand Down
3 changes: 3 additions & 0 deletions kiosk/src/Components/GameSlide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ interface IProps {
addButtonSelected: boolean;
deleteButtonSelected: boolean;
game: GameData;
locked: boolean;
}
const GameSlide: React.FC<IProps> = (
{ highScores,
addButtonSelected,
deleteButtonSelected,
game,
locked
}) => {
const buttonSelected = addButtonSelected || deleteButtonSelected;
const carouselSelected = buttonSelected ? "unselected" : "selected";
Expand All @@ -38,6 +40,7 @@ const GameSlide: React.FC<IProps> = (
</div>
}
{ game.userAdded &&
!locked &&
<DeleteButton focused={deleteButtonSelected} />
}
</div>
Expand Down
7 changes: 5 additions & 2 deletions kiosk/src/Models/Kiosk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down
Loading