From: Ardis Lu Date: Thu, 4 Apr 2024 05:51:07 +0000 (-0700) Subject: Do not show "no events" message if input is blank X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=01cbb813e1aeb42eb24b4bf8666355d8dce75cfc;p=event-hashes Do not show "no events" message if input is blank 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. --- diff --git a/index.html b/index.html index bdc7021..adab3dd 100644 --- a/index.html +++ b/index.html @@ -365,6 +365,11 @@ 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) {