diff --git a/app/components/Settings/TextInput.tsx b/app/components/Settings/TextInput.tsx index 46d4b55..b6eea20 100644 --- a/app/components/Settings/TextInput.tsx +++ b/app/components/Settings/TextInput.tsx @@ -48,7 +48,6 @@ const TextInput: FunctionComponent = ({ ); const handleSaveClick = () => { onChange(text); - setText(value); }; useEffect(() => { diff --git a/app/helpers/static-text.ts b/app/helpers/static-text.ts index 546b8ae..a932f24 100644 --- a/app/helpers/static-text.ts +++ b/app/helpers/static-text.ts @@ -162,8 +162,6 @@ export const settingsText = { getSettingsError: (path: string) => `Error while getting settings file in ${path}: `, setInvalidSettingsError: 'Trying to set invalid settings', - owmlChildOfManagerError: - "OWML can't be in a sub-path of the Mod Manager. Move OWML elsewhere.", setInvalidOwmlSettingsError: 'Trying to set invalid OWML settings', steamParamsWarning: { message: 'Steam might show a warning before starting the game', diff --git a/app/services/get-mod-database.ts b/app/services/get-mod-database.ts index 09b0903..0d34259 100644 --- a/app/services/get-mod-database.ts +++ b/app/services/get-mod-database.ts @@ -29,6 +29,7 @@ export type ModDatabase = { modManager: ModManager; }; +// eslint-disable-next-line import/prefer-default-export export async function getModDatabase( url: string, owmlPath: string diff --git a/app/services/settings-manager.ts b/app/services/settings-manager.ts index 5c3afcc..242cbd8 100644 --- a/app/services/settings-manager.ts +++ b/app/services/settings-manager.ts @@ -1,5 +1,4 @@ import fs from 'fs-extra'; -import { relative } from 'path'; import { remote } from 'electron'; import config from '../config.json'; @@ -27,30 +26,18 @@ export async function getSettings(path: string) { } export function writeSettings(settings: Settings) { - try { - if (!settings) { - throw new Error(settingsText.setInvalidSettingsError); - } - - debugConsole.log('writing app settings'); + if (!settings) { + throw new Error(settingsText.setInvalidSettingsError); + } - if (!relative('.', settings.owmlPath).startsWith('..')) { - throw new Error(settingsText.owmlChildOfManagerError); - } + debugConsole.log('writing app settings'); - const constrainedSettings: Settings = { - ...settings, - logToSocket: settings.closeOnPlay ? false : settings.logToSocket, - }; + const constrainedSettings: Settings = { + ...settings, + logToSocket: settings.closeOnPlay ? false : settings.logToSocket, + }; - fs.writeJsonSync(getSettingsPath(), constrainedSettings); - } catch (error) { - remote.dialog.showMessageBox({ - type: 'error', - title: remote.app.name, - message: error.message, - }); - } + fs.writeJsonSync(getSettingsPath(), constrainedSettings); } export function writeOwmlSettings(path: string, settings: OwmlSettings) {