mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
dddacb9eaa
Co-authored-by: Opender Singh <opender.singh@konghq.com>
24 lines
664 B
TypeScript
24 lines
664 B
TypeScript
import electron from 'electron';
|
|
import { omit } from 'ramda';
|
|
|
|
import { getConfigSettings } from '../models/helpers/settings';
|
|
import { exitApp } from './electron-helpers';
|
|
|
|
export const validateInsomniaConfig = () => {
|
|
const configSettings = getConfigSettings();
|
|
if ('error' in configSettings) {
|
|
const errors = configSettings.error.errors?.map(omit(['parentSchema', 'data']));
|
|
|
|
electron.dialog.showErrorBox('Invalid Insomnia Config',
|
|
[
|
|
`Invalid Insomnia Config found at "${configSettings.error.configPath}"`,
|
|
'',
|
|
'errors:',
|
|
`${JSON.stringify(errors, null, 2)}`,
|
|
].join('\n'),
|
|
);
|
|
|
|
exitApp();
|
|
}
|
|
};
|