summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/admin_settings.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/admin_console/admin_settings.jsx')
-rw-r--r--webapp/components/admin_console/admin_settings.jsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/webapp/components/admin_console/admin_settings.jsx b/webapp/components/admin_console/admin_settings.jsx
index e29be33d1..eda2d1d8a 100644
--- a/webapp/components/admin_console/admin_settings.jsx
+++ b/webapp/components/admin_console/admin_settings.jsx
@@ -85,20 +85,26 @@ export default class AdminSettings extends React.Component {
);
}
- parseInt(str) {
+ parseInt(str, defaultValue) {
const n = parseInt(str, 10);
if (isNaN(n)) {
+ if (defaultValue) {
+ return defaultValue;
+ }
return 0;
}
return n;
}
- parseIntNonZero(str) {
+ parseIntNonZero(str, defaultValue) {
const n = parseInt(str, 10);
if (isNaN(n) || n < 1) {
+ if (defaultValue) {
+ return defaultValue;
+ }
return 1;
}