Skip to content

Commit 803ed64

Browse files
committed
Don't reimplement sanityCheck
1 parent 5ea4c3a commit 803ed64

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Diff for: src/renderer/components/pages/ConfigPage.tsx

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as path from 'path';
33
import { IAppConfigData } from '../../../shared/config/IAppConfigData';
44
import { PathInput } from '../config/PathInput';
55
import { Toggle } from '../config/Toggle';
6+
import { isFlashpointValidCheck } from '../../../main/checkSanity';
67

78
export interface IConfigPageProps {
89
config: IAppConfigData;
@@ -31,8 +32,8 @@ export class ConfigPage extends React.Component<IConfigPageProps, IConfigPageSta
3132
<p className="setting__title"><b>FlashPoint Path:</b></p>
3233
</div>
3334
<div className="setting__row flashpoint-path">
34-
<PathInput defaultInput={config.flashpointPath}
35-
onInputChange={this.onFlashpointPathChange}
35+
<PathInput defaultInput={config.flashpointPath}
36+
onInputChange={this.onFlashpointPathChange}
3637
isValid={this.state.isFlashpointPathValid} />
3738
</div>
3839
</div>
@@ -48,10 +49,8 @@ export class ConfigPage extends React.Component<IConfigPageProps, IConfigPageSta
4849
);
4950
}
5051

51-
onFlashpointPathChange(filePath: string): void {
52-
// Check if the filepath points to a valid FlashPoint folder
53-
const xmlPath = path.join(filePath, './Arcade/Data/Platforms/Flash.xml');
54-
const isValid = window.External.existsSync(xmlPath);
52+
async onFlashpointPathChange(filePath: string) {
53+
const isValid = await isFlashpointValidCheck(filePath);
5554
this.setState({ isFlashpointPathValid: isValid });
5655
}
5756
}

0 commit comments

Comments
 (0)