]> git.ardis.lu - event-hashes/commitdiff
Do not show "no events" message if input is blank
authorArdis Lu <ardisglu@gmail.com>
Thu, 4 Apr 2024 05:51:07 +0000 (22:51 -0700)
committerArdis Lu <ardisglu@gmail.com>
Thu, 4 Apr 2024 05:51:07 +0000 (22:51 -0700)
It doesn't make sense to say "no events were found" if there is no input. This can be confusing if a user clears their input and expects the tool to revert to its initial state.

index.html

index bdc70217484a1434ec84b30638562b243df5a4b7..adab3dda49287a783e1b06e8c4968670bc3a069f 100644 (file)
       buttonContainer.style.setProperty('opacity', 0);
       tableBody.innerHTML = '';
 
+      // Input has been cleared, reset back to default state
+      if (textarea.value === '') {
+        return;
+      }
+
       const events = getEvents(textarea.value);
       const uniqueEvents = Array.from(new Set(events));
       if (events.length === 0) {
This page took 0.039301 seconds and 4 git commands to generate.