File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ export interface CustomSortPluginSettings {
1717}
1818
1919const MILIS = 1000
20- const DEFAULT_DELAY_SECONDS = 0
21- const DELAY_MIN_SECONDS = 1
20+ const DEFAULT_DELAY_SECONDS = 1
21+ const DELAY_MIN_SECONDS = 0
2222const DELAY_MAX_SECONDS = 30
2323const DEFAULT_DELAY = DEFAULT_DELAY_SECONDS * MILIS
2424
@@ -78,8 +78,8 @@ export class CustomSortSettingTab extends PluginSettingTab {
7878 . addText ( text => text
7979 . setValue ( `${ this . plugin . settings . delayForInitialApplication / MILIS } ` )
8080 . onChange ( async ( value ) => {
81- let delayS = parseInt ( value , 10 )
82- delayS = Number . isNaN ( delayS ) ? DEFAULT_DELAY_SECONDS : ( delayS < DELAY_MIN_SECONDS ? DELAY_MIN_SECONDS :( delayS > DELAY_MAX_SECONDS ? DELAY_MAX_SECONDS : delayS ) )
81+ let delayS = parseFloat ( value )
82+ delayS = ( Number . isNaN ( delayS ) || ! Number . isFinite ( ( delayS ) ) ) ? DEFAULT_DELAY_SECONDS : ( delayS < DELAY_MIN_SECONDS ? DELAY_MIN_SECONDS :( delayS > DELAY_MAX_SECONDS ? DELAY_MAX_SECONDS : delayS ) )
8383 delayS = Math . round ( delayS * 10 ) / 10 // allow values like 0.2
8484 this . plugin . settings . delayForInitialApplication = delayS * MILIS
8585 await this . plugin . saveSettings ( )
You can’t perform that action at this time.
0 commit comments