File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -390,11 +390,19 @@ function getReg() {
390390 return reg ;
391391}
392392
393- /**
394- * read log from file
395- * @returns {Promise<string> }
396- */
393+ // Trap to block consecutive file picker calls within one second (prevents multiple pickers when holding Ctrl+Meta+L)
394+ let filePickerBlocked = false ;
395+
397396function readLogFromFile ( ) {
397+ // Set a trap to block consecutive calls within one second
398+ if ( filePickerBlocked ) {
399+ return ;
400+ }
401+ filePickerBlocked = true ;
402+ setTimeout ( ( ) => {
403+ filePickerBlocked = false ;
404+ } , 1000 ) ;
405+
398406 // TODO: This would probably be better off in ./src/utility/gamelog.ts
399407 return new Promise ( ( resolve , reject ) => {
400408 const fileInput = document . createElement ( 'input' ) as HTMLInputElement ;
You can’t perform that action at this time.
0 commit comments