File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,9 +220,9 @@ const settings = wrap(() => {
220220 setting . onChange = ( el ) => {
221221 let val = '' ;
222222 if ( setting . type === 'boolean' ) {
223- if ( el . is ( ':checked' ) ) val = '1' ;
223+ if ( el . is ( ':checked' ) ) val = 1 ;
224224 else if ( setting . remove ) val = false ; // Only remove if it's expected
225- else val = '0' ;
225+ else val = 0 ;
226226 } else if ( setting . type === 'select' ) {
227227 val = el . val ( ) ;
228228 } else if ( setting . type === 'remove' ) {
@@ -239,14 +239,14 @@ const settings = wrap(() => {
239239 debug ( `Unknown Setting Type: ${ setting . type } ` ) ;
240240 return ;
241241 }
242- if ( typeof data . onChange === 'function' ) {
243- data . onChange ( val , localStorage . getItem ( setting . key ) ) ;
244- }
245242 if ( val === false ) {
246243 localStorage . removeItem ( setting . key ) ;
247244 } else {
248245 localStorage . setItem ( setting . key , val ) ;
249246 }
247+ if ( typeof data . onChange === 'function' ) {
248+ data . onChange ( val , localStorage . getItem ( setting . key ) ) ;
249+ }
250250 } ;
251251 conf . settings [ setting . key ] = setting ;
252252 if ( ! settingReg . hasOwnProperty ( setting . key ) ) {
You can’t perform that action at this time.
0 commit comments