diff options
author | Willy Woitas <dutscher_sbf@hotmail.com> | 2024-02-18 01:49:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 06:19:42 +0530 |
commit | 315728415b2269981a04ee51af7ef18412d7bf70 (patch) | |
tree | 1ee3e41e7022fa376b99bff5413eb6119481b839 /src/components/settings | |
parent | 6.7.1-nightly.20 [skip ci] (diff) | |
download | ferdium-app-315728415b2269981a04ee51af7ef18412d7bf70.tar.gz ferdium-app-315728415b2269981a04ee51af7ef18412d7bf70.tar.zst ferdium-app-315728415b2269981a04ee51af7ef18412d7bf70.zip |
feat: Parse 2FA SMS token and copy to clipboard (#1561)
Diffstat (limited to 'src/components/settings')
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.tsx | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.tsx b/src/components/settings/settings/EditSettingsForm.tsx index 6a79fcc8f..81cfe8b12 100644 --- a/src/components/settings/settings/EditSettingsForm.tsx +++ b/src/components/settings/settings/EditSettingsForm.tsx | |||
@@ -303,6 +303,8 @@ interface IProps extends WrappedComponentProps { | |||
303 | isClearingAllCache: boolean; | 303 | isClearingAllCache: boolean; |
304 | isTodosActivated: boolean; | 304 | isTodosActivated: boolean; |
305 | automaticUpdates: boolean; | 305 | automaticUpdates: boolean; |
306 | isTwoFactorAutoCatcherEnabled: boolean; | ||
307 | twoFactorAutoCatcherMatcher: string; | ||
306 | isDarkmodeEnabled: boolean; | 308 | isDarkmodeEnabled: boolean; |
307 | isAdaptableDarkModeEnabled: boolean; | 309 | isAdaptableDarkModeEnabled: boolean; |
308 | isUseGrayscaleServicesEnabled: boolean; | 310 | isUseGrayscaleServicesEnabled: boolean; |
@@ -354,7 +356,8 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
354 | this.props.form.submit({ | 356 | this.props.form.submit({ |
355 | onSuccess: (form: Form) => { | 357 | onSuccess: (form: Form) => { |
356 | const values = form.values(); | 358 | const values = form.values(); |
357 | const { accentColor } = values; | 359 | const { accentColor, isTwoFactorAutoCatcherEnabled } = values; |
360 | |||
358 | if (accentColor.trim().length === 0) { | 361 | if (accentColor.trim().length === 0) { |
359 | values.accentColor = DEFAULT_ACCENT_COLOR; | 362 | values.accentColor = DEFAULT_ACCENT_COLOR; |
360 | } | 363 | } |
@@ -362,6 +365,15 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
362 | if (progressbarAccentColor.trim().length === 0) { | 365 | if (progressbarAccentColor.trim().length === 0) { |
363 | values.progressbarAccentColor = DEFAULT_ACCENT_COLOR; | 366 | values.progressbarAccentColor = DEFAULT_ACCENT_COLOR; |
364 | } | 367 | } |
368 | |||
369 | // set twoFactorAutoCatcherMatcher to the default value, if its get enabled the input is prefilled | ||
370 | if ( | ||
371 | !isTwoFactorAutoCatcherEnabled && | ||
372 | values.twoFactorAutoCatcherMatcher.length === 0 | ||
373 | ) { | ||
374 | values.twoFactorAutoCatcherMatcher = | ||
375 | DEFAULT_APP_SETTINGS.twoFactorAutoCatcherMatcher; | ||
376 | } | ||
365 | this.props.onSubmit(values); | 377 | this.props.onSubmit(values); |
366 | }, | 378 | }, |
367 | onError: noop, | 379 | onError: noop, |
@@ -386,6 +398,7 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
386 | onClearAllCache, | 398 | onClearAllCache, |
387 | getCacheSize, | 399 | getCacheSize, |
388 | automaticUpdates, | 400 | automaticUpdates, |
401 | isTwoFactorAutoCatcherEnabled, | ||
389 | isDarkmodeEnabled, | 402 | isDarkmodeEnabled, |
390 | isSplitModeEnabled, | 403 | isSplitModeEnabled, |
391 | openProcessManager, | 404 | openProcessManager, |
@@ -837,6 +850,15 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
837 | <Toggle {...form.$('notifyTaskBarOnMessage').bind()} /> | 850 | <Toggle {...form.$('notifyTaskBarOnMessage').bind()} /> |
838 | )} | 851 | )} |
839 | 852 | ||
853 | <Toggle {...form.$('isTwoFactorAutoCatcherEnabled').bind()} /> | ||
854 | |||
855 | {isTwoFactorAutoCatcherEnabled && ( | ||
856 | <Input | ||
857 | onChange={e => this.submit(e)} | ||
858 | {...form.$('twoFactorAutoCatcherMatcher').bind()} | ||
859 | /> | ||
860 | )} | ||
861 | |||
840 | <Hr /> | 862 | <Hr /> |
841 | 863 | ||
842 | <Select field={form.$('webRTCIPHandlingPolicy')} /> | 864 | <Select field={form.$('webRTCIPHandlingPolicy')} /> |