File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,15 @@ import React from 'react';
22import { IndexLink } from 'react-router' ;
33import Settings from './Config/Settings.jsx' ;
44
5+ //https://stackoverflow.com/a/1414175
6+ function stringToBoolean ( string ) {
7+ switch ( string . toLowerCase ( ) . trim ( ) ) {
8+ case "true" : case "yes" : case "1" : return true ;
9+ case "false" : case "no" : case "0" : case null : return false ;
10+ default : return Boolean ( string ) ;
11+ }
12+ }
13+
514class ConfigContent extends React . Component {
615 constructor ( props ) {
716 super ( props ) ;
@@ -42,7 +51,7 @@ class ConfigContent extends React.Component {
4251 this . setState ( { serverSettings : change } ) ;
4352 return ;
4453 }
45- fieldValue = Boolean ( e . target . value )
54+ fieldValue = stringToBoolean ( e . target . value )
4655 } else if ( e . target . id === "admins" || e . target . id === "tags" ) {
4756 // Split settings values that are stored as arrays
4857 fieldValue = e . target . value . split ( "," )
You can’t perform that action at this time.
0 commit comments