From 91581f620a6f05d27d517fae59d155c4440f18ad Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Wed, 1 Jun 2022 22:17:58 -0700 Subject: [PATCH] alert when game is not found --- src/ui/components/ServerLaunchSection.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/components/ServerLaunchSection.tsx b/src/ui/components/ServerLaunchSection.tsx index e4953c5..cb58e15 100644 --- a/src/ui/components/ServerLaunchSection.tsx +++ b/src/ui/components/ServerLaunchSection.tsx @@ -107,7 +107,12 @@ export default class ServerLaunchSection extends React.Component } // Launch the program - await invoke('run_program', { path: config.game_install_path }) + const gameExists = await invoke('dir_exists', { + path: config.game_install_path + }) + + if (gameExists) await invoke('run_program', { path: config.game_install_path }) + else alert('Game not found!') } async launchServer() {