The-CodingSloth / haha-funny-leetcode-extension

MIT License
396 stars 75 forks source link

Bug: userJustSubmitted race condition #28

Closed Erik-McKelvey closed 10 months ago

Erik-McKelvey commented 10 months ago

The timeout in the onMessageReceived function in backjground.js introduces a race condition if the user hits submit more than once within 30 seconds:

case 'userClickedSubmit':
  userJustSubmitted = true;
  setTimeout(() => {
    userJustSubmitted = false;
  }, 30000); // Reset after 30 seconds
  break;

I can fix it

The-CodingSloth commented 10 months ago

sweet sounds good thanks for noticing