From 0e9aa805e1a5002a2ff6572f1aa5024aaea90d28 Mon Sep 17 00:00:00 2001 From: Filipe Dobreira Date: Thu, 7 Dec 2023 21:43:40 +0000 Subject: [PATCH] Nothing ish about the new check --- frontend/composables/use-quick-search.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/composables/use-quick-search.ts b/frontend/composables/use-quick-search.ts index c4d4583..da92fae 100644 --- a/frontend/composables/use-quick-search.ts +++ b/frontend/composables/use-quick-search.ts @@ -19,9 +19,9 @@ function isCodeFragment(event: KeyboardEvent): boolean { } /** - * Performs a naive check to ensure something is a EAN13 or UPC-A code. + * Performs a check to ensure something is a EAN13 or UPC-A code. */ -function isValidIshCode(code: string): boolean { +function isValidCode(code: string): boolean { try { // We check the format in advance, since we're only accepting EAN13 and UPC-A here. // There's no -real- reason for this limitation, besides protecting against feature @@ -93,7 +93,7 @@ export function useQuickSearch() { // Reset the buffer: codeBuffer.value = fragment; } - } else if (event.key === "Enter" && isValidIshCode(codeBuffer.value)) { + } else if (event.key === "Enter" && isValidCode(codeBuffer.value)) { // If we have an active code buffer that seems valid, and the user presses Enter, // we want to generate a new search query from this code, as long as it seems valid. // @@ -130,7 +130,6 @@ export function useQuickSearch() { }); return { - codeBuffer, isActive, }; }