From 6bf565534eb5df47b16f8d0c70f04b46878a1254 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Tue, 19 Sep 2023 16:27:25 -0700 Subject: [PATCH] show toast on game delete --- kiosk/src/Components/DeletionModal.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kiosk/src/Components/DeletionModal.tsx b/kiosk/src/Components/DeletionModal.tsx index c1645dd83623..f81ed9f6f037 100644 --- a/kiosk/src/Components/DeletionModal.tsx +++ b/kiosk/src/Components/DeletionModal.tsx @@ -6,6 +6,7 @@ import { AppStateContext } from "../State/AppStateContext"; import * as Storage from "../Services/LocalStorage"; import { removeGame } from "../Transforms/removeGame"; import { gamepadManager } from "../Services/GamepadManager"; +import { postNotification } from "../Transforms/postNotification"; interface IProps { active: (p: boolean) => void; @@ -22,9 +23,14 @@ const DeletionModal: React.FC = ({ active, changeFocus }) => { const userAddedGames = Storage.getAddedGames(); const gameId = kiosk.selectedGameId; if (gameId && gameId in userAddedGames) { + const name = userAddedGames[gameId].name; userAddedGames[gameId].deleted = true; Storage.setAddedGames(userAddedGames); removeGame(gameId); + postNotification({ + message: `${name} deleted`, + duration: 5000, + }); } };