Update index.tsx
This commit is contained in:
parent
196fe0e044
commit
fdc7880faa
|
|
@ -7,14 +7,14 @@ import { Game } from "@renderer/types";
|
||||||
const GameCard = ({ title, path, is_running, img_cover, id, }: Game) => {
|
const GameCard = ({ title, path, is_running, img_cover, id, }: Game) => {
|
||||||
const [status, setStatus] = useState<string>("");
|
const [status, setStatus] = useState<string>("");
|
||||||
|
|
||||||
function startGame(id) {
|
async function startGame(id) {
|
||||||
window.electron.launchApp(id, path);
|
window["Umbra"].startGame(id, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.electron.onAppStatus((status) => {
|
window["Umbra"].onAppStatus((status) => {
|
||||||
if (status.id === id) {
|
if (status.id === id) {
|
||||||
let newStatus = status.status === "started" ? "Lancé" : status.status === "closed" ? "" : status.status;
|
let newStatus = status.status === 1 ? "Lancé" : status.status === 0 ? "" : status.status;
|
||||||
setStatus(newStatus);
|
setStatus(newStatus);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Reference in a new issue