diff --git a/src/ui/Main.tsx b/src/ui/Main.tsx index 757aae9..96fee11 100644 --- a/src/ui/Main.tsx +++ b/src/ui/Main.tsx @@ -198,6 +198,16 @@ export class Main extends React.Component { async componentDidUpdate(prevProps: Readonly, prevState: Readonly) { const game_path = await getConfigOption('game_install_path') + // Check if game exists at set location + const game_exists: boolean = ((await invoke('dir_exists', { + path: game_path, + })) as boolean) + + // Set no game path so the user understands it doesn't exist there + if (!game_exists) { + setConfigOption('game_install_path', '') + } + //if previous state is not equal the current one - update the game_install_path to be the current game path if (prevState.game_install_path != game_path) { this.setState({