diff --git a/lib/gui/app/components/settings/settings.tsx b/lib/gui/app/components/settings/settings.tsx index 115431e5..34d2465b 100644 --- a/lib/gui/app/components/settings/settings.tsx +++ b/lib/gui/app/components/settings/settings.tsx @@ -19,7 +19,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import * as _ from 'lodash'; import * as os from 'os'; import * as React from 'react'; -import { Checkbox, Flex, Modal as SmallModal, Txt } from 'rendition'; +import { Checkbox, Flex, Txt } from 'rendition'; import { version, packageType } from '../../../../../package.json'; import * as settings from '../../models/settings'; @@ -29,36 +29,6 @@ import { Modal } from '../../styled-components'; const platform = os.platform(); -interface WarningModalProps { - message: string; - confirmLabel: string; - cancel: () => void; - done: () => void; -} - -const WarningModal = ({ - message, - confirmLabel, - cancel, - done, -}: WarningModalProps) => { - return ( - - {message} - - ); -}; - interface Setting { name: string; label: string | JSX.Element; @@ -97,13 +67,6 @@ async function getSettingsList(): Promise { ]; } -interface Warning { - setting: string; - settingValue: boolean; - description: string; - confirmLabel: string; -} - interface SettingsModalProps { toggleModal: (value: boolean) => void; } @@ -127,7 +90,6 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) { } })(); }); - const [warning, setWarning] = React.useState(undefined); const toggleSetting = async ( setting: string, @@ -142,22 +104,12 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) { dangerous, }); - if (value || options === undefined) { - await settings.set(setting, !value); - setCurrentSettings({ - ...currentSettings, - [setting]: !value, - }); - setWarning(undefined); - return; - } else { - // Show warning since it's a dangerous setting - setWarning({ - setting, - settingValue: value, - ...options, - }); - } + await settings.set(setting, !value); + setCurrentSettings({ + ...currentSettings, + [setting]: !value, + }); + return; }; return ( @@ -205,24 +157,6 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) { {version} - - {warning === undefined ? null : ( - { - await settings.set(warning.setting, !warning.settingValue); - setCurrentSettings({ - ...currentSettings, - [warning.setting]: true, - }); - setWarning(undefined); - }} - cancel={() => { - setWarning(undefined); - }} - /> - )} ); }