()
| 7 | import { rendererLogInfo } from '../../utils/core/logger'; |
| 8 | |
| 9 | export const SettingsReset: FC = () => { |
| 10 | const { resetSettings } = useAppContext(); |
| 11 | |
| 12 | const confirm = useConfirm(); |
| 13 | |
| 14 | const handleReset = async () => { |
| 15 | const confirmed = await confirm({ |
| 16 | title: 'Reset settings?', |
| 17 | content: |
| 18 | 'Please confirm that you want to reset all settings to the Gitify defaults', |
| 19 | |
| 20 | confirmButtonContent: 'Reset', |
| 21 | cancelButtonContent: 'Cancel', |
| 22 | confirmButtonType: 'danger', |
| 23 | }); |
| 24 | |
| 25 | if (confirmed) { |
| 26 | resetSettings(); |
| 27 | rendererLogInfo('settingsReset', 'Settings have been reset to defaults'); |
| 28 | } |
| 29 | }; |
| 30 | |
| 31 | return ( |
| 32 | <Stack align="center"> |
| 33 | <Button |
| 34 | className="w-[200px]" |
| 35 | data-testid="settings-reset" |
| 36 | onClick={handleReset} |
| 37 | variant="danger" |
| 38 | > |
| 39 | Reset Settings |
| 40 | </Button> |
| 41 | </Stack> |
| 42 | ); |
| 43 | }; |
nothing calls this directly
no test coverage detected