diff options
author | 2022-07-09 08:15:51 +0530 | |
---|---|---|
committer | 2022-07-09 08:49:36 +0530 | |
commit | 71b43aea3d4fc05b982f23c1157b41020d5f30d8 (patch) | |
tree | d294d300452fa538b4318b7ff7a0e625459e060f | |
parent | Update submodules, browserslist data updates and linter fixes [skip ci] (diff) | |
download | ferdium-app-71b43aea3d4fc05b982f23c1157b41020d5f30d8.tar.gz ferdium-app-71b43aea3d4fc05b982f23c1157b41020d5f30d8.tar.zst ferdium-app-71b43aea3d4fc05b982f23c1157b41020d5f30d8.zip |
Use the default accent color if the user removes value from textbox
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.jsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.jsx b/src/components/settings/settings/EditSettingsForm.jsx index a2168f4fc..4ae431adb 100644 --- a/src/components/settings/settings/EditSettingsForm.jsx +++ b/src/components/settings/settings/EditSettingsForm.jsx | |||
@@ -17,6 +17,7 @@ import Infobox from '../../ui/Infobox'; | |||
17 | import { H1, H2, H3, H5 } from '../../ui/headline'; | 17 | import { H1, H2, H3, H5 } from '../../ui/headline'; |
18 | 18 | ||
19 | import { | 19 | import { |
20 | DEFAULT_ACCENT_COLOR, | ||
20 | DEFAULT_APP_SETTINGS, | 21 | DEFAULT_APP_SETTINGS, |
21 | FRANZ_TRANSLATION, | 22 | FRANZ_TRANSLATION, |
22 | GITHUB_FRANZ_URL, | 23 | GITHUB_FRANZ_URL, |
@@ -299,6 +300,14 @@ class EditSettingsForm extends Component { | |||
299 | this.props.form.submit({ | 300 | this.props.form.submit({ |
300 | onSuccess: form => { | 301 | onSuccess: form => { |
301 | const values = form.values(); | 302 | const values = form.values(); |
303 | const accentColor = values.accentColor; | ||
304 | if (accentColor.trim().length === 0) { | ||
305 | values.accentColor = DEFAULT_ACCENT_COLOR; | ||
306 | } | ||
307 | const progressbarAccentColor = values.progressbarAccentColor; | ||
308 | if (progressbarAccentColor.trim().length === 0) { | ||
309 | values.progressbarAccentColor = DEFAULT_ACCENT_COLOR; | ||
310 | } | ||
302 | this.props.onSubmit(values); | 311 | this.props.onSubmit(values); |
303 | }, | 312 | }, |
304 | onError: () => {}, | 313 | onError: () => {}, |